broker

package
v0.0.0-...-7c5fa43 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreateOrderTopic = "order.create"
	UpdateCartTopic  = "cart.update"
)

Variables

This section is empty.

Functions

func WithPartitions

func WithPartitions(p int32) func(*createTopic)

Types

type AfterConsumedFunc

type AfterConsumedFunc = func([]byte) error

type Consumer

type Consumer interface {
	Consume(topics string)
	Close() error
}

func NewConsumer

func NewConsumer(addrs, groupID string, afterConsumedFunc AfterConsumedFunc) Consumer

type Producer

type Producer interface {
	CreateTopic(topic string, options ...func(*createTopic)) error
	Publish(topic string, msg []byte)
	Close() error
}

func NewProducer

func NewProducer(addrs string) Producer

Jump to

Keyboard shortcuts

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