Documentation ¶
Index ¶
- Variables
- type Consumer
- func (c *Consumer) Cleanup(sarama.ConsumerGroupSession) error
- func (c *Consumer) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error
- func (c *Consumer) RegisterHandler(topic string, handler handlFunc)
- func (c *Consumer) Setup(sarama.ConsumerGroupSession) error
- func (c *Consumer) Start(ctx context.Context) error
- type ConsumerOptFunc
- type ConsumerOption
- type Producer
- type ProducerOption
- type ProducerOptionFnc
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConsumerOption = &ConsumerOption{ Brokers: []string{"localhost:9092"}, Group: "group_1", Topic: []string{}, Oldest: true, AutoCommit: true, }
View Source
var DefaultProducerOpt = &ProducerOption{ Brokers: []string{"localhost:9092"}, NumProducers: 1, }
Functions ¶
This section is empty.
Types ¶
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
func NewConsumer ¶
func NewConsumer(optFns ...ConsumerOptFunc) (*Consumer, error)
func (*Consumer) ConsumeClaim ¶
func (c *Consumer) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error
func (*Consumer) RegisterHandler ¶
type ConsumerOptFunc ¶
type ConsumerOptFunc func(opt *ConsumerOption) *ConsumerOption
func WithConsumerAutoCommit ¶
func WithConsumerAutoCommit(autoCommit bool) ConsumerOptFunc
func WithConsumerBrokers ¶
func WithConsumerBrokers(brokers []string) ConsumerOptFunc
func WithConsumerGroup ¶
func WithConsumerGroup(group string) ConsumerOptFunc
func WithConsumerOldest ¶
func WithConsumerOldest(oldest bool) ConsumerOptFunc
type ConsumerOption ¶
type Producer ¶
type Producer struct {
// contains filtered or unexported fields
}
func NewProducer ¶
func NewProducer(optFns ...ProducerOptionFnc) (*Producer, error)
func (*Producer) SendMessage ¶
type ProducerOption ¶
type ProducerOptionFnc ¶
type ProducerOptionFnc func(opt *ProducerOption) *ProducerOption
func WithNumProducers ¶
func WithNumProducers(numProducers int) ProducerOptionFnc
func WithProducerBrokers ¶
func WithProducerBrokers(brokers []string) ProducerOptionFnc
func WithProducerTopic ¶
func WithProducerTopic(topic string) ProducerOptionFnc
Click to show internal directories.
Click to hide internal directories.