kafka

package
v0.0.0-...-1fef448 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientFactory

type ClientFactory interface {
	// NewProducer returns a new Producer instance configured with the specified `config`
	NewProducer(config kafka.ConfigMap) (Producer, error)

	// NewConsumer returns a new Consumer instance configured with the specified `config`
	NewConsumer(config kafka.ConfigMap) (Consumer, error)
}

ClientFactory provides methods for creating new Producer and Consumer instances

func NewClientFactory

func NewClientFactory() ClientFactory

NewClientFactory returns a new ClientFactory instance

type Consumer

type Consumer interface {
	Subscribe(topic string, rebalanceCb kafka.RebalanceCb) error
	ReadMessage(timeout time.Duration) (*kafka.Message, error)
	Commit() ([]kafka.TopicPartition, error)
	CommitOffsets(offsets []kafka.TopicPartition) ([]kafka.TopicPartition, error)
	Close() error
}

Consumer allows clients to read messages from Kafka NB: this interface exists for mocking purposes

type ErrorEvent

type ErrorEvent = kafka.Error

ErrorEvent is a type alias for confluent-kafka-go's message delivery error notification returned on the `deliveryChan` provided to the Producer's Produce() method

type Event

type Event = kafka.Event

Event is a type alias for confluent-kafka-go's delivery event type returned on the `deliveryChan` provided to the Producer's Produce() method

type MessageDeliveredEvent

type MessageDeliveredEvent = kafka.Message

MessageDeliveredEvent is a type alias for confluent-kafka-go's message delivered notification returned on the `deliveryChan` provided to the Producer's Produce() method

type Producer

type Producer interface {
	Produce(msg *kafka.Message, deliveryChan chan kafka.Event) error
	Flush(timoutMs int) int
	Close()
}

Producer allows clients to send messages to Kafka NB: this interface exists for mocking purposes

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳