Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface { // Subscribe returns a new Subscription iterator for `topic`. Subscribe(ctx context.Context, topic string) (Subscription, error) // PublishEvent sends `data` to all listening remotes on `topic`. PublishEvent(topic string, data []byte) error }
Backend is the backend that backends of the event subsystem must fulfill.
type Message ¶
type Message interface { // Data is the data that is sent alongside the message. Data() []byte // Source is the addr of the remote. Source() string }
Message is returned by Subscribe. It encapsulates a single event message coming from another remote.
type Subscription ¶
type Subscription interface { io.Closer // Next blocks until receiving a new message or fails with // context.Canceled if the cancel func was called. Next(ctx context.Context) (Message, error) }
Subscription is an iterator like interface for accessing and listening for messages from other remotes.
Click to show internal directories.
Click to hide internal directories.