mq

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: GPL-3.0 Imports: 4 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 interface {
	ReceiveAndHandle(h KafkaHandler) error
}

func NewConsumer

func NewConsumer(cfg ConsumerConfig) Consumer

type ConsumerConfig

type ConsumerConfig struct {
	Brokers []string
	Topic   string
	GroupID string
	Debug   bool
}

type KafkaHandler

type KafkaHandler interface {
	Handle(ctx context.Context, msg *Message) error
}

type Message

type Message = kafka.Message

type Producer

type Producer interface {
	Publish(ctx context.Context, key, payload []byte) error
}

func NewProducer

func NewProducer(cfg ProducerConfig) Producer

type ProducerConfig

type ProducerConfig struct {
	Brokers []string
	Topic   string
	Debug   bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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