interfaces

package
v4.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrokerGenerator

type BrokerGenerator = func(addr string) SaramaBroker

BrokerGenerator is a function that returns a sarama broker interface

type ConsumerGroupInitialiser

type ConsumerGroupInitialiser = func(addrs []string, groupID string, config *sarama.Config) (sarama.ConsumerGroup, error)

ConsumerGroupInitialiser is a function that returns a sarama consumer group interface

type Message

type Message interface {

	// GetData returns the message contents.
	GetData() []byte

	// GetHeader takes a key for the header and returns the value if the key exist in the header.
	GetHeader(key string) string

	// Context returns a context with traceid.
	Context() context.Context

	// Mark marks the message as consumed, but doesn't commit the offset to the backend
	Mark()

	// Commit marks the message as consumed and commits its offset to the backend
	Commit()

	// Release closes the UpstreamDone channel for this message
	Release()

	// CommitAndRelease marks a message as consumed, commits it and closes the UpstreamDone channel
	CommitAndRelease()

	// Offset returns the message offset
	Offset() int64

	// UpstreamDone returns the upstreamDone channel. Closing this channel notifies that the message has been consumed
	UpstreamDone() chan struct{}
}

Message represents a single kafka message.

type ProducerInitialiser

type ProducerInitialiser = func(addrs []string, config *sarama.Config) (sarama.AsyncProducer, error)

ProducerInitialiser is a function that returns a sarama async producer interface

type SaramaAsyncProducer

type SaramaAsyncProducer = sarama.AsyncProducer

SaramaAsyncProducer is an alias for sarama.AsyncProducer

type SaramaBroker

type SaramaBroker interface {
	Addr() string
	Connected() (bool, error)
	Open(conf *sarama.Config) error
	GetMetadata(request *sarama.MetadataRequest) (*sarama.MetadataResponse, error)
	Close() error
}

type SaramaConsumerGroup

type SaramaConsumerGroup = sarama.ConsumerGroup

SaramaConsumerGroup is an alias for sarama.ConsumerGroup

type SaramaConsumerGroupClaim

type SaramaConsumerGroupClaim = sarama.ConsumerGroupClaim

SaramaConsumerGroupClaim is an alias for sarama.ConsumerGroupClaim

type SaramaConsumerGroupSession

type SaramaConsumerGroupSession = sarama.ConsumerGroupSession

SaramaConsumerGroupSession is an alias for sarama.ConsumerGroupSession

Jump to

Keyboard shortcuts

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