Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Publish ¶ added in v0.2.7
Publish may be used by Backend implementations to provide backoff and retry for network problems.
func Register ¶
func Register(name string, fn Constructor) error
Register register a new broker backend under a name. It is tipically used in init functions.
Types ¶
type Backend ¶
type Backend interface { Publish(topic string, data []byte) error // Subscribe associates a message handler function to a particular topic. // The backend must handle the messages to all the subscribers. The message // must only be regarded as consumed when all the handlers have returned and // none of them returned a non-nil value. Subscribe(topic string, cb Handler) // Verify the availability of a topic. Check(topic string) error Close() error }
Backend is a low-level interface used to interact with RDSS brokers.
type Backoff ¶ added in v0.2.7
Backoff wraps a network retry backoff type to control backoff periods. Typically we want the 3rd-party backoff structure, but others, e.g. a test version can be used instead.
type Constructor ¶
Constructor is a function that initializes and returns a Backend implementation with the given options.
type DialOpts ¶
DialOpts is a daisy-chaining mechanism for setting options to a backend during Dial.
func WithKeyValue ¶
WithKeyValue sets a key-value pair as option. If called multiple times with the same key, the last one wins.
func WithOptions ¶
WithOptions parses a string in the format "key1=value1,key2=value2,..." where keys and values are specific to each storage backend. Neither key nor value may contain the characters "," or "=". Use WithKeyValue repeatedly if these characters need to be used.