kafkax

package
v1.2.12 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Config

func Config(v *viper.Viper)

func NewDefaultKafkaConfig added in v1.2.8

func NewDefaultKafkaConfig() *sarama.Config

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