Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsumerGroupRunner ¶
type ConsumerGroupRunner struct { // ErrorHandlerFn handles any errors found while consuming. // If it is nil errors are ignored. ErrorHandlerFn func(err error) // LogFn is used to log any debug/info messages from the runner. // Leave as nil if you do not want any log messages. LogFn func(format string, a ...interface{}) // contains filtered or unexported fields }
ConsumerGroupRunner is used to run and gracefully shutdown a consumer group.
func NewConsumerGroupRunner ¶
func NewConsumerGroupRunner( addrs []string, groupID string, config *sarama.Config, topics []string, handler sarama.ConsumerGroupHandler, ) *ConsumerGroupRunner
NewConsumerGroupRunner returns a runner that controls the start-up and graceful shutdown of a consumer group.
type ProducerRunner ¶
type ProducerRunner struct { // ErrorHandlerFn is used to handle errors when producing messages. // If this is null, errors are ignored. ErrorHandlerFn func(err *sarama.ProducerError) // SuccessHandlerFn is used to handle successfully produced messages. // If this is null, it is ignored. SuccessHandlerFn func(message *sarama.ProducerMessage) // contains filtered or unexported fields }
ProducerRunner is used publish messages async through channels.
func NewProducerRunner ¶
func NewProducerRunner(addrs []string, config *sarama.Config) *ProducerRunner
NewProducerRunner returns a producer runner that can publish messages async through channels.
func (*ProducerRunner) Input ¶
func (cgr *ProducerRunner) Input() chan<- *sarama.ProducerMessage
Click to show internal directories.
Click to hide internal directories.