kafka

package
v0.0.0-...-18be65f Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsumerInfo

type ConsumerInfo struct {
	Signal    chan os.Signal
	Partition int32
	Consumer  sarama.Consumer
}

type KafkaConnector

type KafkaConnector struct {
	Brokers   []string
	Config    sarama.Config
	Producers map[string]sarama.SyncProducer
	Consumers map[string][]ConsumerInfo
}

func NewKafkaConnector

func NewKafkaConnector(brokers []string) *KafkaConnector

func (*KafkaConnector) NewConsumer

func (c *KafkaConnector) NewConsumer(topic string, partition int32, onMessage func(data []byte))

func (*KafkaConnector) NewProducer

func (c *KafkaConnector) NewProducer(topic string) (*sarama.SyncProducer, error)

func (*KafkaConnector) TerminateConsumer

func (c *KafkaConnector) TerminateConsumer(topic string, partition int32)

Jump to

Keyboard shortcuts

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