local

package
v0.4.11 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotSubscribed = errors.New("topic is not subscribed")

Functions

This section is empty.

Types

type Local

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

Local is a simple implementation of the transport.Transport interface using local channels.

func New

func New(id []byte, queue int, topics map[string]transport.Message) *Local

New returns a new instance of the Local structure. The created transport can as many unread messages before it is blocked as defined in the queue arg. The list of supported subscriptions must be given as a map in the topics argument, where the key is the subscription's topic name, and the map value is the message type messages given as a nil pointer, e.g: (*Message)(nil).

func (*Local) Broadcast

func (l *Local) Broadcast(topic string, message transport.Message) error

Broadcast implements the transport.Transport interface.

func (*Local) ID added in v0.4.9

func (l *Local) ID() []byte

ID implements the transport.Transport interface.

func (*Local) Messages

func (l *Local) Messages(topic string) chan transport.ReceivedMessage

Messages implements the transport.Transport interface.

func (*Local) Start

func (l *Local) Start(ctx context.Context) error

Start implements the transport.Transport interface.

func (*Local) Wait

func (l *Local) Wait() chan error

Wait implements the transport.Transport interface.

Jump to

Keyboard shortcuts

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