kafka

package
v0.0.0-...-50b78f6 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConsumerGroupConfig

func GetConsumerGroupConfig() *sarama.Config

func Uuid

func Uuid() string

Types

type Callback

type Callback func(message *sarama.ConsumerMessage)

type ConsumerGroup

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

func NewConsumerGroup

func NewConsumerGroup(conf *ConsumerGroupConf, fn Callback) (*ConsumerGroup, error)

func (*ConsumerGroup) Close

func (c *ConsumerGroup) Close()

type ConsumerGroupConf

type ConsumerGroupConf struct {
	Topic   string   `yaml:"topic"`
	Brokers []string `yaml:"brokers"`
	GroupId string   `yaml:"groupId"`
}

type ProducerConf

type ProducerConf struct {
	Topic   string   `yaml:"topic"`
	Brokers []string `yaml:"brokers"`
}

type SyncProducer

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

func NewSyncProducer

func NewSyncProducer(conf *ProducerConf) (SyncProducer, error)

func (*SyncProducer) Close

func (p *SyncProducer) Close()

func (*SyncProducer) SendByteMessage

func (p *SyncProducer) SendByteMessage(topic string, value []byte) error

func (*SyncProducer) SendProducerMessage

func (p *SyncProducer) SendProducerMessage(msg *sarama.ProducerMessage) error

func (*SyncProducer) SendStringMessage

func (p *SyncProducer) SendStringMessage(topic, value string) error

Jump to

Keyboard shortcuts

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