kafka

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: MIT Imports: 7 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonKafka added in v1.4.0

type CommonKafka interface {
	GetKafkaWriter() Writer
	Close()
	SetLog(log.Logger)
}

func NewCommonKafka added in v1.4.0

func NewCommonKafka(ctx context.Context, di ConfigDI, topic string) CommonKafka

type ConfigDI added in v1.0.0

type ConfigDI interface {
	NewKafkaWriter(ctx context.Context, topic string) Writer
	NewKafkaReader(ctx context.Context, groupID, topic string, l log.Logger) Reader
}

type KafkaConfig added in v1.4.0

type KafkaConfig struct {
	Brokers []string
}

func (*KafkaConfig) NewKafkaReader added in v1.4.0

func (c *KafkaConfig) NewKafkaReader(ctx context.Context, groupID, topic string, l log.Logger) Reader

func (*KafkaConfig) NewKafkaWriter added in v1.4.0

func (c *KafkaConfig) NewKafkaWriter(ctx context.Context, topic string) Writer

type Reader

type Reader interface {
	Read() (map[string]string, []byte, error)
	ReadHandler(handler ReaderHandler) error
	Close() error
}

type ReaderHandler added in v1.4.0

type ReaderHandler func(headers map[string]string, data []byte) error

type Writer

type Writer interface {
	SetLog(log.Logger)
	Message(headers map[string][]byte, msg []byte) error
	Close() error
}

Jump to

Keyboard shortcuts

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