Documentation ¶
Index ¶
- type BatchConsumer
- type BatchConsumerConf
- type BatchConsumerOption
- type ConsumeHandle
- type ConsumeHandler
- type Consumer
- func (c *Consumer) Cleanup(session sarama.ConsumerGroupSession) error
- func (c *Consumer) Close() error
- func (c *Consumer) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error
- func (c *Consumer) FetchMessage(ctx context.Context) (message *sarama.ConsumerMessage, err error)
- func (c *Consumer) Setup(sarama.ConsumerGroupSession) error
- type ConsumerConfig
- type IConsumer
- type Producer
- type ProducerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchConsumer ¶
type BatchConsumer struct {
// contains filtered or unexported fields
}
func NewBatchConsumer ¶
func NewBatchConsumer(cfg BatchConsumerConf, handler ConsumeHandler, consumer IConsumer, opts ...BatchConsumerOption) *BatchConsumer
func (*BatchConsumer) GracefulStop ¶
func (bc *BatchConsumer) GracefulStop(ctx context.Context)
func (*BatchConsumer) Start ¶
func (bc *BatchConsumer) Start()
func (*BatchConsumer) Stop ¶
func (bc *BatchConsumer) Stop()
type BatchConsumerConf ¶
type BatchConsumerOption ¶
type BatchConsumerOption func(*batchConsumerOptions)
func WithLogger ¶
func WithLogger(logger log15.Logger) BatchConsumerOption
type ConsumeHandle ¶
type ConsumeHandler ¶
func WithHandle ¶
func WithHandle(handle ConsumeHandle) ConsumeHandler
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
func NewConsumer ¶
func NewConsumer(cfg ConsumerConfig, logger log15.Logger) *Consumer
func (*Consumer) Cleanup ¶
func (c *Consumer) Cleanup(session sarama.ConsumerGroupSession) error
Cleanup is run at the end of a session, once all ConsumeClaim goroutines have exited but before the offsets are committed for the very last time.
func (*Consumer) ConsumeClaim ¶
func (c *Consumer) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error
ConsumeClaim must start a consumer loop of ConsumerGroupClaim's Messages(). Once the Messages() channel is closed, the Handler must finish its processing loop and exit.
func (*Consumer) FetchMessage ¶
FetchMessage 读取并返回message
type ConsumerConfig ¶
type Producer ¶
type Producer struct {
// contains filtered or unexported fields
}
func NewProducer ¶
func NewProducer(cfg ProducerConfig) *Producer
type ProducerConfig ¶
Click to show internal directories.
Click to hide internal directories.