Documentation ¶
Overview ¶
Package broker is an interface used for asynchronous messaging
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker interface { // Init initializes the broker Init(opts Options) error // Options Returns the broker options Options() Options // Address Returns the broker bind interface Address() string // Connect connects to the broker Connect() error // Disconnect disconnects from the broker Disconnect() error // Publish publishes a message to the topic Publish(topic string, m proto.Message) error // Publish publishes raw data to the topic PublishRaw(topic string, m []byte) error // Subscribe subscribes a handler to the topic Subscribe(topic string, h interface{}) (Subscriber, error) // SubscribeRaw subscribes a raw handler to the topic SubscribeRaw(topic string, h func(c context.Context, data []byte) error) (Subscriber, error) // Handle returns the raw connection handle to the broker Handle() interface{} }
Broker is an interface used for asynchronous messaging.
type Subscriber ¶
type Subscriber interface { // Topic returns the subscribed topic Topic() string // Unsubscribe unsubscribes to the topic Unsubscribe() error }
Subscriber is a convenience return type for the Subscribe method
Click to show internal directories.
Click to hide internal directories.