pubsub

package
v0.0.0-...-2254657 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTopic

func CreateTopic(topic misc.TopicId)

func DeleteTopic

func DeleteTopic(topic misc.TopicId)

func SendMessage

func SendMessage(msg Message)

func TopicExists

func TopicExists(topic misc.TopicId) bool

Types

type Consumer

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

func NewConsumer

func NewConsumer(log *slog.Logger, groupID string, topic misc.TopicId, msgHandler TopicMessageHandler) *Consumer

func (*Consumer) AddTopic

func (c *Consumer) AddTopic(topic misc.TopicId)

func (*Consumer) RemoveTopic

func (c *Consumer) RemoveTopic(topic misc.TopicId)

func (*Consumer) StartConsumer

func (c *Consumer) StartConsumer(v Message)

type Message

type Message interface {
	String() string
	Topic() misc.TopicId
	Unmarshal([]byte)
}

type TopicMessageHandler

type TopicMessageHandler interface {
	OnMessageFromTopic(msg Message)
}

Jump to

Keyboard shortcuts

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