kafka

package
v0.0.0-...-3579b89 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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 *sarama.Config, logger *log.Logger, topic string, groupID string, brokers []string) *Consumer

func (Consumer) CloseConnection

func (c Consumer) CloseConnection()

func (Consumer) Consume

func (c Consumer) Consume()

type ConsumerGroupHandler

type ConsumerGroupHandler struct{}

ConsumerGroupHandler represents the sarama consumer group

func (ConsumerGroupHandler) Cleanup

Cleanup is run at the end of a session, once all ConsumeClaim goroutines have exited

func (ConsumerGroupHandler) ConsumeClaim

ConsumeClaim must start a consumer loop of ConsumerGroupClaim's Messages(), here is supposed to be what you want to do with the message. In this example the message will be logged with the topic name, partition and message value.

func (ConsumerGroupHandler) Setup

Setup is run before consumer start consuming, is normally used to setup things such as database connections

type Producer

type Producer struct {
	// contains filtered or unexported fields
}

func NewProducer

func NewProducer(config *sarama.Config, logger *log.Logger, topic string, brokers []string) *Producer

func (*Producer) Publish

func (p *Producer) Publish(message string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL