pubsub

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

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

func NewMessage

func NewMessage(msg []byte, topic string) *Message

func (*Message) Payload

func (m *Message) Payload() []byte

func (*Message) Topic

func (m *Message) Topic() string

type PubSub

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

func NewPubSub

func NewPubSub() *PubSub

func (*PubSub) Publish

func (b *PubSub) Publish(topic string, msg []byte)

func (*PubSub) Subscribe

func (b *PubSub) Subscribe(topic string) *Subscriber

func (*PubSub) Unsubscribe

func (b *PubSub) Unsubscribe(s *Subscriber, topic string)

type Subscriber

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

func NewSubscriber

func NewSubscriber() *Subscriber

func (*Subscriber) Close

func (s *Subscriber) Close()

func (*Subscriber) GetMessages

func (s *Subscriber) GetMessages() <-chan *Message

type Subscribers

type Subscribers map[string]*Subscriber

Jump to

Keyboard shortcuts

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