Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message interface { Broker() MessageBroker Topic() string Payload() []byte }
Message is an interface because I'm one of the cool kids.
func NewMessage ¶
func NewMessage(broker MessageBroker, topic string, payload []byte) Message
NewMessage returns an actual implementation for Message, which is useful in creating your own PubSub implementation. Lots of copies, but I really don't care at the moment.
type MessageBroker ¶
type MessageBroker interface { Disconnect(quiesce uint) Publish(topic string, qos byte, retain bool, data []byte) Subscribe(topic string, qos byte, callback func(Message)) }
MessageBroker is a subset of MQTT functionality since I'm currently using MQTT for pub/sub. I suppose it will change a bit if I switch to another protocol.
It is only in a module to get out of naming hell. A namespace is useful here.
Click to show internal directories.
Click to hide internal directories.