pkg

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 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 Consumer

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

func NewConsumer

func NewConsumer(brokers []string, topic string, groupID string, opts ...Option) *Consumer

func (*Consumer) Close

func (c *Consumer) Close()

func (*Consumer) Consume

func (c *Consumer) Consume(ctx context.Context, handle func(ctx context.Context, msg kafka.Message) error)

type ConsumerOption

type ConsumerOption interface {
	Option
	Apply(option)
}

type Option

type Option interface {
	Apply(option)
}

func WithAuthentication

func WithAuthentication(username string, password string) Option

type Producer

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

func NewProducer

func NewProducer(brokers []string, topic string, opts ...Option) *Producer

func (*Producer) Produce

func (p *Producer) Produce(ctx context.Context, message kafka.Message) error

type ProducerOption

type ProducerOption interface {
	Option
	Apply(option)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳