Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Brokers required, kafka brokers separated by comma. Brokers string // Group required, kafka consumer group. Group string // SaramaConfig required, kafka sarama config. SaramaConfig *sarama.Config // Name optional, kafka server name to be exposed. Name string }
Config http config server.
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
Consumer represents a Sarama consumer group consumer
func (*Consumer) Cleanup ¶
func (consumer *Consumer) Cleanup(group sarama.ConsumerGroupSession) error
Cleanup is run at the end of a session, once all ConsumeClaim goroutines have exited
func (*Consumer) ConsumeClaim ¶
func (consumer *Consumer) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error
ConsumeClaim must start a consumer loop of ConsumerGroupClaim's Messages().
type HandlerFunc ¶
type HandlerFunc func(ctx context.Context, message *sarama.ConsumerMessage) error
type Option ¶
type Option interface {
Apply(o *options)
}
func RegisterRoute ¶
func RegisterRoute(topic string, handler HandlerFunc) Option
RegisterRoute function to add route to server.
func RegisterRoutes ¶
func RegisterRoutes(handlers map[string]HandlerFunc) Option
RegisterRoutes function to add multi route to server.
Click to show internal directories.
Click to hide internal directories.