syncproducer

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SendOptions added in v1.0.15

type SendOptions func(msg *sarama.ProducerMessage)

func HeadersOption added in v1.0.15

func HeadersOption(headers []sarama.RecordHeader) SendOptions

func MetadataOption added in v1.0.15

func MetadataOption(data any) SendOptions

func PartitionKeyOption added in v1.0.15

func PartitionKeyOption(partitionKey string) SendOptions

type SyncProducer

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

func NewSyncProducer

func NewSyncProducer(
	cfg common.Config,
	logger *zap.Logger,
	opts ...SyncProducerOption,
) (*SyncProducer, error)

func (*SyncProducer) Close

func (sp *SyncProducer) Close() error

func (*SyncProducer) Send

func (sp *SyncProducer) Send(topic string, message []byte, opts ...SendOptions) error

type SyncProducerOption

type SyncProducerOption func(sp *SyncProducer)

func ConfigOption

func ConfigOption(cfg *sarama.Config) SyncProducerOption

Jump to

Keyboard shortcuts

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