kafkagoproducer

package
v0.0.0-...-18de4b0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(setters ...Setter) producer.Producer

Types

type Producer

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

func (*Producer) AsyncSendMsg

func (p *Producer) AsyncSendMsg(ctx context.Context, topic string, key string, msg any) error

func (*Producer) SyncSendMsg

func (p *Producer) SyncSendMsg(ctx context.Context, topic string, key string, msg any) error

type Setter

type Setter func(p *Producer)

func SetAddr

func SetAddr(addr ...string) Setter

func SetAllowAutoTopicCreation

func SetAllowAutoTopicCreation(allowAutoTopicCreation bool) Setter

func SetBalancer

func SetBalancer(balancer kafka.Balancer) Setter

func SetBatchBytes

func SetBatchBytes(batchBytes int64) Setter

func SetBatchSize

func SetBatchSize(batchSize int) Setter

func SetBatchTimeout

func SetBatchTimeout(batchTimeout time.Duration) Setter

func SetCompletion

func SetCompletion(completion func(messages []kafka.Message, err error)) Setter

func SetCompression

func SetCompression(compression kafka.Compression) Setter

func SetLogger

func SetLogger(logger logger.LogWriter) Setter

func SetMaxAttempts

func SetMaxAttempts(maxAttempts int) Setter

func SetMsgType

func SetMsgType(msgType message.MsgType) Setter

func SetReadTimeout

func SetReadTimeout(readTimeout time.Duration) Setter

func SetRequiredAcks

func SetRequiredAcks(requiredAcks kafka.RequiredAcks) Setter

func SetTopicList

func SetTopicList(topic ...string) Setter

func SetTransport

func SetTransport(transport kafka.RoundTripper) Setter

func SetWriteBackoffMax

func SetWriteBackoffMax(writeBackoffMax time.Duration) Setter

func SetWriteBackoffMin

func SetWriteBackoffMin(writeBackoffMin time.Duration) Setter

func SetWriteTimeout

func SetWriteTimeout(writeTimeout time.Duration) Setter

Jump to

Keyboard shortcuts

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