Documentation
¶
Index ¶
Constants ¶
View Source
const ( CONNECT = uint8(iota + 1) PUBLISH SUBSCRIBE UNSUBSCRIBE PINGREQ PINGRESP DISCONNECT Contract = uint32(3376684800) )
View Source
const ( SubscriberDirect = SubscriberType(iota) SubscriberRemote )
Subscriber types
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct { MessageID uint16 `json:"message_id,omitempty"` // The ID of the message Topic []byte `json:"topic,omitempty"` // The topic of the message Payload []byte `json:"data,omitempty"` // The payload of the message Qos uint8 `json:"qos,omitempty"` // The qos of the message TTL int64 `json:"ttl,omitempty"` // The time-to-live of the message }
Message represents a message which has to be forwarded or stored.
type MessageIds ¶
func NewMessageIds ¶
func NewMessageIds() MessageIds
func (*MessageIds) FreeID ¶
func (mids *MessageIds) FreeID(id MID)
func (*MessageIds) GetType ¶
func (mids *MessageIds) GetType(id MID) uint8
func (*MessageIds) NextID ¶
func (mids *MessageIds) NextID(pktType uint8) MID
func (*MessageIds) Reset ¶
func (mids *MessageIds) Reset(id MID)
type Stats ¶
Stats represents a subscription map.
type Subscriber ¶
type Subscriber interface { ID() string Type() SubscriberType SendMessage(*Message) bool }
Subscriber is a value associated with a subscription.
type TopicAnyCount ¶
type TopicAnyCount uint8
Click to show internal directories.
Click to hide internal directories.