consumer

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: BSD-3-Clause Imports: 6 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
}

Consumer handles the message processing logic.

func New

func New(client KafkaClient, processor processor.Processor, logger *zap.SugaredLogger, producer *internalKgo.Producer) *Consumer

func (*Consumer) Run

func (c *Consumer) Run(ctx context.Context)

type Fetches

type Fetches interface {
	Errors() []kgo.FetchError
	EachRecord(func(*kgo.Record))
}

Fetches defines the interface for the result of a poll operation.

type KafkaClient

type KafkaClient interface {
	PollFetches(context.Context) Fetches
	Close()
}

KafkaClient defines the interface for the Kafka client operations we need.

type KgoClientAdapter

type KgoClientAdapter struct {
	Client *kgo.Client
}

KgoClientAdapter adapts the concrete *kgo.Client to our KafkaClient interface.

func (*KgoClientAdapter) Close

func (a *KgoClientAdapter) Close()

func (*KgoClientAdapter) PollFetches

func (a *KgoClientAdapter) PollFetches(ctx context.Context) Fetches

Jump to

Keyboard shortcuts

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