producer

package
v0.0.0-...-da226d4 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateOptions

type CreateOptions struct {
	NumPartitions     int
	ReplicationFactor int
}

type Option

type Option func(conf *conf)

func WithBalancer

func WithBalancer(balancer kafka.Balancer) Option

func WithCreateTopic

func WithCreateTopic(numPartitions, replicationFactor int) Option

func WithCredentials

func WithCredentials(algo, user, password, cert string) Option

func WithLog

func WithLog() Option

type Producer

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

func New

func New(ctx context.Context, hosts []string, topic string, options ...Option) (*Producer, error)

func (*Producer) Close

func (p *Producer) Close() error

func (*Producer) Produce

func (p *Producer) Produce(ctx context.Context, keyAndMessage ...[]byte) error

Jump to

Keyboard shortcuts

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