Documentation
¶
Overview ¶
Package kafka provides Kafka message queue sending wrapper.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetProducer ¶
func GetProducer() result.Result[sarama.SyncProducer]
GetProducer returns the Kafka sync producer and initialization error.
Types ¶
type KafkaSender ¶
type KafkaSender struct {
// contains filtered or unexported fields
}
KafkaSender sends messages to the specified topic.
func (*KafkaSender) Push ¶
func (p *KafkaSender) Push(data map[string]interface{}) result.VoidResult
Push sends data as JSON to the configured topic.
func (*KafkaSender) SetTopic ¶
func (p *KafkaSender) SetTopic(topic string)
SetTopic sets the topic for sending messages.
Click to show internal directories.
Click to hide internal directories.