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 DeliveryMode uint8 `json:"delivery_mode,omitempty"` // The delivery mode of the message Delay int32 `json:"delay,omitempty"` // The time in milliseconds to delay the delivery of the message Topic string `json:"topic,omitempty"` // The topic of the message Payload []byte `json:"data,omitempty"` // The payload 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) utp.MessageType
func (*MessageIds) NextID ¶
func (mids *MessageIds) NextID(pktType utp.MessageType) MID
func (*MessageIds) Reset ¶
func (mids *MessageIds) Reset()
func (*MessageIds) ResumeID ¶
func (mids *MessageIds) ResumeID(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.