kafkax

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Config

func Config(v *viper.Viper)

Types

type Client added in v1.0.20

type Client interface {
	// Get get kafka client
	Get() sarama.Client

	// Close close kafka client
	Close() error

	// SendMessage send message to kafka
	SendMessage(ctx context.Context, message *sarama.ProducerMessage) error

	// GroupConsume consume kafka group
	GroupConsume(ctx context.Context, group string, topics []string, handler sarama.ConsumerGroupHandler) error
}

Client is a kafka client wrapper

func New added in v1.0.20

func New(name string, cfg ...*sarama.Config) (Client, error)

New create a kafka client

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL