kafka

package
v0.0.0-...-f6b4a90 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKafkaInput

func NewKafkaInput(content interface{}) (protocol.Input, error)

Types

type Consumer

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

func (*Consumer) Cleanup

func (consumer *Consumer) Cleanup(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().

func (*Consumer) Setup

func (consumer *Consumer) Setup(sarama.ConsumerGroupSession) error

Setup is run at the beginning of a new session, before ConsumeClaim

type KafkaConfig

type KafkaConfig struct {
	Base      config.ConfigBase
	Brokers   []string `yaml:"brokers"`
	GroupName string   `yaml:"group_name"`
	Topic     string   `yaml:"topic"`
	Version   string   `yaml:"version"`
	Schema    string   `yaml:"schema"`
	// Worker is the number of workers in sarama
	Worker int `yaml:"worker"`
}

type KafkaInput

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

func (*KafkaInput) Emit

func (input *KafkaInput) Emit() map[string]interface{}

func (*KafkaInput) Run

func (input *KafkaInput) Run()

func (*KafkaInput) Stop

func (input *KafkaInput) Stop()

Jump to

Keyboard shortcuts

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