Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConsumerCfgOption ¶
func FromNewest ¶
func FromNewest() ConsumerCfgOption
type KafkaConsumer ¶
type KafkaConsumer struct {
// contains filtered or unexported fields
}
func NewKafkaConsumer ¶
func NewKafkaConsumer( kafkaBrokers []string, consumerGroupID string, topics []string, cfgOptions ...ConsumerCfgOption, ) (*KafkaConsumer, error)
func (*KafkaConsumer) AddFallback ¶
func (c *KafkaConsumer) AddFallback(fn FallbackFunc)
func (*KafkaConsumer) AddHandler ¶
func (c *KafkaConsumer) AddHandler(messageType string, handler MessageHandler)
func (*KafkaConsumer) HealthCheck ¶ added in v2.1.1
func (c *KafkaConsumer) HealthCheck(_ context.Context) bool
type KafkaProducer ¶
type KafkaProducer struct {
// contains filtered or unexported fields
}
Producer.
func NewKafkaProducer ¶
func NewKafkaProducer(kafkaBrokers []string) (*KafkaProducer, error)
NewKafkaProducer.
func (KafkaProducer) HealthCheck ¶ added in v2.1.1
func (p KafkaProducer) HealthCheck(_ context.Context) bool
func (*KafkaProducer) Send ¶
func (p *KafkaProducer) Send(topic, key string, message interface{}) error
Send a message to a topic to be scattered using the key.
type Marshaller ¶ added in v2.1.0
Marshaller is an interface to serialize messages to kfkTopics.
type MessageHandler ¶
type MessageHandler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(handlerFunc interface{}) MessageHandler
type Unmarshaller ¶ added in v2.1.0
Click to show internal directories.
Click to hide internal directories.