kafka

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SecurityOptions

func SecurityOptions(protocol string, sslConf *config.KafkaSSL, saslConf *config.KafkaSASL) ([]kgo.Opt, error)

SecurityOptions translates the security_protocol / ssl / sasl config blocks into franz-go client options. The config keys mirror librdkafka's, which is what the Python engine configures.

Types

type Option

type Option func(*Source)

func WithChannelBuffer

func WithChannelBuffer(size int) Option

func WithLogger

func WithLogger(logger *zap.Logger) Option

func WithReadTimeout

func WithReadTimeout(timeout time.Duration) Option

type Source

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

func NewSource

func NewSource(client *kgo.Client, opts ...Option) (*Source, error)

func (*Source) Close

func (k *Source) Close() error

func (*Source) Commit

func (k *Source) Commit() error

func (*Source) CommitMarks added in v1.0.4

func (k *Source) CommitMarks(marks map[string]map[int32]core.Mark) error

CommitMarks commits exactly the positions the pipeline has finished with.

Commit above commits everything this source has fetched, and the poll goroutine fetches well ahead of the pipeline: after one 20,000-message batch it had committed offset 70,086. A crash then lost the difference with the consumer group showing no lag. Kafka commits the next offset to read, so a mark at offset N commits N+1.

func (*Source) Start

func (k *Source) Start() error

func (*Source) Stream

func (k *Source) Stream() <-chan []core.Message

Jump to

Keyboard shortcuts

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