kafka

package
v1.0.16 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = types.Module{
	{CreateFunc: NewKafka},
	{CreateFunc: CreateConfig},
}

Functions

func CreateConfig

func CreateConfig(cfg *config.Config) common.Config

Types

type ConsumerGroup

type ConsumerGroup interface {
	AddHandler(topic common.Topic, hm common.MessageHandler)
	Consume()
	Close() error
}

type Kafka

type Kafka struct {
	// contains filtered or unexported fields
}

func NewKafka

func NewKafka(cfg common.Config, logger *zap.Logger) *Kafka

func (*Kafka) NewConsumerGroup

func (k *Kafka) NewConsumerGroup(nameGroup string, opts ...consumergroup.ConsumerGroupOption) (ConsumerGroup, error)

func (*Kafka) NewSyncProducer

func (k *Kafka) NewSyncProducer(opts ...syncproducer.SyncProducerOption) (SyncProducer, error)

type SyncProducer

type SyncProducer interface {
	Send(topic string, message []byte, opts ...syncproducer.SendOptions) error
	Close() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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