kafkago

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

func New

func New(c sk.ProducerConfig, options ...OptionFunc) (*Handler, error)

New creates a new kafka producer

func (*Handler) Send

func (h *Handler) Send(topic string, value []byte) error

func (*Handler) Stop

func (h *Handler) Stop()

type Logger

type Logger interface {
	Infof(string, ...interface{})
	Errorf(string, ...interface{})
}

type OptionFunc

type OptionFunc func(*Handler) error

func WithLogger

func WithLogger(log Logger) OptionFunc

type Producer

type Producer interface {
	Close() error
	SendWithKey(topic string, key, value []byte) error
}

type SimpleKafkaGoProducer

type SimpleKafkaGoProducer struct {
	Writer
	// contains filtered or unexported fields
}

func (*SimpleKafkaGoProducer) SendWithKey

func (p *SimpleKafkaGoProducer) SendWithKey(topic string, key, value []byte) error

type Writer

type Writer interface {
	Close() error
	WriteMessages(ctx context.Context, msgs ...kafka.Message) error
}

Jump to

Keyboard shortcuts

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