broker

package
v0.0.0-...-bcfd2cf Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kafka

type Kafka struct {
	*kafka.Writer
	*kafka.Reader
}

Kafka instance of Kafka writer

func NewKafka

func NewKafka(kafkaBrokerUrls []string, topic string) (*Kafka, error)

NewKafka initialize kafka broker

func (*Kafka) Close

func (k *Kafka) Close() (err error)

Close closes reader connection

func (*Kafka) Pull

func (k *Kafka) Pull(ctx context.Context) (m kafka.Message, err error)

Pull reads a message from kafka topic

func (*Kafka) Push

func (k *Kafka) Push(ctx context.Context, key, value string) (err error)

Push writes message to kafka topic

Jump to

Keyboard shortcuts

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