sarama

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addrs []string
	*sarama.Config
}

func (*Config) AfterInject

func (c *Config) AfterInject()

AfterInject is a no-op satisfying the Config interface.

func (*Config) BeforeInject

func (c *Config) BeforeInject()

BeforeInject is a no-op satisfying the Config interface.

type Consumer

type Consumer struct {
	sarama.Consumer
	Conf ConsumerConfig
}

func (*Consumer) Close

func (c *Consumer) Close() error

Close closes the Sarama consumer.

func (*Consumer) Config

func (c *Consumer) Config() any

Config returns the embedded Conf (with a fresh sarama.Config) as the configuration for injection.

func (*Consumer) Init

func (c *Consumer) Init() error

Init creates the Sarama consumer and stores it.

type ConsumerConfig

type ConsumerConfig Config

func (*ConsumerConfig) AfterInject

func (c *ConsumerConfig) AfterInject()

AfterInject delegates to Config.AfterInject.

func (*ConsumerConfig) BeforeInject

func (c *ConsumerConfig) BeforeInject()

BeforeInject is a no-op satisfying the Config interface.

func (*ConsumerConfig) Build

func (c *ConsumerConfig) Build() (sarama.Consumer, error)

Build creates a Sarama Kafka consumer.

type Producer

type Producer struct {
	sarama.SyncProducer
	Conf ProducerConfig
}

func (*Producer) Close

func (p *Producer) Close() error

Close closes the Sarama sync producer.

func (*Producer) Config

func (p *Producer) Config() any

Config returns the embedded Conf (with a fresh sarama.Config) as the configuration for injection.

func (*Producer) Init

func (p *Producer) Init() error

Init creates the Sarama sync producer and stores it.

type ProducerConfig

type ProducerConfig Config

func (*ProducerConfig) AfterInject

func (c *ProducerConfig) AfterInject()

AfterInject delegates to Config.AfterInject.

func (*ProducerConfig) BeforeInject

func (c *ProducerConfig) BeforeInject()

BeforeInject is a no-op satisfying the Config interface.

func (*ProducerConfig) Build

func (c *ProducerConfig) Build() (sarama.SyncProducer, error)

Build creates a Sarama synchronous Kafka producer.

Jump to

Keyboard shortcuts

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