Documentation ¶
Index ¶
- type Kafka
- func (k *Kafka) Check() error
- func (k *Kafka) Close()
- func (k *Kafka) CreateTopic(topic string) error
- func (k *Kafka) GetAdminClient() (sarama.ClusterAdmin, error)
- func (k *Kafka) GetConsumer() (sarama.Consumer, error)
- func (k *Kafka) GetConsumerGroup(id string) (sarama.ConsumerGroup, error)
- func (k *Kafka) GetProducer() (sarama.AsyncProducer, error)
- func (k *Kafka) Init(kafkaConfigUrl string)
- func (k *Kafka) MessageListener(groupId, topic string, listener func(msg string) error) error
- func (k *Kafka) Send(topic, data string) error
- func (k *Kafka) SendMsgs(topic string, data []string) error
- type MsgHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Kafka ¶
type Kafka struct {
// contains filtered or unexported fields
}
func (*Kafka) CreateTopic ¶
func (*Kafka) GetAdminClient ¶
func (k *Kafka) GetAdminClient() (sarama.ClusterAdmin, error)
func (*Kafka) GetConsumerGroup ¶
func (k *Kafka) GetConsumerGroup(id string) (sarama.ConsumerGroup, error)
func (*Kafka) GetProducer ¶
func (k *Kafka) GetProducer() (sarama.AsyncProducer, error)
func (*Kafka) MessageListener ¶
type MsgHandler ¶
func (MsgHandler) Cleanup ¶
func (MsgHandler) Cleanup(_ sarama.ConsumerGroupSession) error
func (MsgHandler) ConsumeClaim ¶
func (h MsgHandler) ConsumeClaim(sess sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error
func (MsgHandler) Setup ¶
func (MsgHandler) Setup(_ sarama.ConsumerGroupSession) error
Click to show internal directories.
Click to hide internal directories.