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: 2 modules, 10 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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