kafka

package
v0.0.0-...-5ba8ac2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const AppName = "kafka"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	ioc.ObjectImpl

	Username     string   `json:"username" yaml:"username"`
	Password     string   `json:"password" yaml:"password"`
	Brokers      []string `json:"brokers" yaml:"brokers"`
	Async        bool     `json:"async" yaml:"async"`
	BatchTimeout int      `json:"batchTimeout" yaml:"batchTimeout"`
	Offset       int64    `json:"offset" yaml:"offset"`
	// contains filtered or unexported fields
}

func (*Client) Close

func (c *Client) Close(ctx context.Context) error

func (*Client) Consumer

func (c *Client) Consumer(topic, groupId string) *kafka.Reader

func (*Client) Init

func (c *Client) Init()

func (*Client) Name

func (c *Client) Name() string

func (*Client) Priority

func (c *Client) Priority() int

func (*Client) Producer

func (c *Client) Producer(topic string) *kafka.Writer

type Service

type Service interface {
	Producer(topic string) *kafka.Writer
	Consumer(topic, groupId string) *kafka.Reader
}

func GetClient

func GetClient() Service

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳