Documentation ¶
Index ¶
- type Consumer
- func (c *Consumer) Cleanup(sarama.ConsumerGroupSession) error
- func (c *Consumer) Close() error
- func (c *Consumer) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error
- func (c *Consumer) Setup(sarama.ConsumerGroupSession) error
- func (c *Consumer) Start()
- func (c *Consumer) Subscribe(handler ConsumerHandler)
- type ConsumerConfig
- type ConsumerHandler
- type ProducerConfig
- type SyncProducer
- type TraceInterceptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
func NewConsumer ¶
func NewConsumer(config *ConsumerConfig) *Consumer
func (*Consumer) Cleanup ¶
func (c *Consumer) Cleanup(sarama.ConsumerGroupSession) error
Cleanup is run at the end of a session, once all ConsumeClaim goroutines have exited
func (*Consumer) ConsumeClaim ¶
func (c *Consumer) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error
ConsumeClaim must start a consumer loop of ConsumerGroupClaim's Messages().
func (*Consumer) Setup ¶
func (c *Consumer) Setup(sarama.ConsumerGroupSession) error
Setup is run at the beginning of a new session, before ConsumeClaim
func (*Consumer) Subscribe ¶
func (c *Consumer) Subscribe(handler ConsumerHandler)
type ConsumerConfig ¶
type ConsumerHandler ¶
type ConsumerHandler func(context.Context, *sarama.ConsumerMessage) error
type ProducerConfig ¶
type SyncProducer ¶
type SyncProducer struct {
// contains filtered or unexported fields
}
func NewSyncProducer ¶
func NewSyncProducer(config *ProducerConfig) *SyncProducer
func (*SyncProducer) Close ¶
func (sp *SyncProducer) Close() error
func (*SyncProducer) SendSyncMsg ¶
func (sp *SyncProducer) SendSyncMsg(ctx context.Context, content string) error
type TraceInterceptor ¶
type TraceInterceptor struct {
TraceID string
}
func (*TraceInterceptor) OnSend ¶
func (ti *TraceInterceptor) OnSend(message *sarama.ProducerMessage)
Click to show internal directories.
Click to hide internal directories.