Documentation
¶
Overview ¶
Package pubsub defines the interface for publish/subscribe messaging used by the stream package. Adapters for NATS, Redis, and in-process channels are provided in sub-packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PubSub ¶
type PubSub interface {
Publish(topic string, data []byte) error
Subscribe(topic string, handler func(data []byte)) (Subscription, error)
Close() error
}
PubSub is the minimal publish/subscribe interface required by the stream Broker. Topics use dot-separated segments with optional wildcards: * matches one segment, > matches the rest.
type Subscription ¶
type Subscription interface {
Unsubscribe() error
}
Subscription represents an active topic subscription.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package chanpubsub provides an in-process PubSub implementation backed by Go channels.
|
Package chanpubsub provides an in-process PubSub implementation backed by Go channels. |
|
Package natspubsub adapts a *nats.Conn to the pubsub.PubSub interface.
|
Package natspubsub adapts a *nats.Conn to the pubsub.PubSub interface. |
|
Package pubsubtest provides a conformance test suite for PubSub implementations.
|
Package pubsubtest provides a conformance test suite for PubSub implementations. |
|
Package redispubsub adapts a Redis client to the pubsub.PubSub interface using PUBLISH / SUBSCRIBE / PSUBSCRIBE.
|
Package redispubsub adapts a Redis client to the pubsub.PubSub interface using PUBLISH / SUBSCRIBE / PSUBSCRIBE. |
Click to show internal directories.
Click to hide internal directories.