kafka

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetReader

func GetReader() *kafka.Reader

GetReader get kafka reader.

func GetWriter

func GetWriter() *kafka.Writer

GetWriter get kafka writer.

func NewReader

func NewReader(ctx context.Context, opts ...Option) (*kafka.Reader, error)

NewReader new kafka reader.

func NewWriter

func NewWriter(ctx context.Context, opts ...Option) (*kafka.Writer, error)

NewWriter new kafka writer.

Types

type Option

type Option func(*Options)

func WithBrokers

func WithBrokers(brokers []string) Option

WithBrokers set kafka brokers.

func WithGroupID

func WithGroupID(groupID string) Option

WithGroupID set kafka group id.

func WithTopic

func WithTopic(topic string) Option

WithTopic set kafka topic.

type Options

type Options struct {
	Brokers []string
	Topic   string
	GroupID string
}

Jump to

Keyboard shortcuts

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