Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- type ConnectToken
- type MessageAndToken
- type MessageHandler
- type PublishToken
- type RegisterToken
- type SNClient
- func (c *SNClient) Connect() *ConnectToken
- func (c *SNClient) Predefine(topic string, topicid uint16) error
- func (c *SNClient) Publish(topic string, qos byte, retain bool, data []byte) *PublishToken
- func (c *SNClient) PublishPredefined(topicid uint16, qos byte, retain bool, data []byte) *PublishToken
- func (c *SNClient) Register(topic string) *RegisterToken
- func (c *SNClient) SetWill(topic string, qos byte, retain bool, data []byte)
- func (c *SNClient) SetWillData(d []byte) *WillToken
- func (c *SNClient) SetWillQos(q byte) *WillToken
- func (c *SNClient) SetWillRetain(r bool) *WillToken
- func (c *SNClient) SetWillTopic(t string) *WillToken
- func (c *SNClient) Subscribe(topic string, qos byte, mh MessageHandler) *SubscribeToken
- func (c *SNClient) SubscribePredefined(topicid uint16, qos byte, mh MessageHandler) *SubscribeToken
- type SubscribeToken
- type Token
- type UnsubscribeToken
- type Will
- type WillToken
Constants ¶
View Source
const ( NET = "[net] " PNG = "[pinger] " CLI = "[client] " DEC = "[decode] " MES = "[message] " STR = "[store] " MID = "[msgids] " TST = "[test] " STA = "[state] " ERR = "[error] " )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
Connect()
}
type ConnectToken ¶
type ConnectToken struct { ReturnCode byte // contains filtered or unexported fields }
func (*ConnectToken) Wait ¶
func (b *ConnectToken) Wait()
Wait will wait indefinitely for the Token to complete, ie the Publish to be sent and confirmed receipt from the broker
type MessageAndToken ¶
type MessageAndToken struct {
// contains filtered or unexported fields
}
type MessageHandler ¶
type MessageHandler func(client *SNClient, message *P.PublishMessage)
type PublishToken ¶
type PublishToken struct { TopicId uint16 ReturnCode byte // contains filtered or unexported fields }
func (*PublishToken) Wait ¶
func (b *PublishToken) Wait()
Wait will wait indefinitely for the Token to complete, ie the Publish to be sent and confirmed receipt from the broker
type RegisterToken ¶
type RegisterToken struct { TopicName string TopicId uint16 ReturnCode byte // contains filtered or unexported fields }
func (*RegisterToken) Wait ¶
func (b *RegisterToken) Wait()
Wait will wait indefinitely for the Token to complete, ie the Publish to be sent and confirmed receipt from the broker
type SNClient ¶
type SNClient struct { sync.RWMutex ClientId string OutstandingMessages map[uint16]P.Message RegisteredTopics map[string]uint16 MessageHandlers map[uint16]MessageHandler PredefinedTopics map[string]uint16 PredefinedMessageHandlers map[uint16]MessageHandler DefaultMessageHandler MessageHandler MessageIds mids // contains filtered or unexported fields }
func (*SNClient) Connect ¶
func (c *SNClient) Connect() *ConnectToken
func (*SNClient) Publish ¶
func (*SNClient) PublishPredefined ¶
func (*SNClient) Register ¶
func (c *SNClient) Register(topic string) *RegisterToken
func (*SNClient) SetWill ¶
func (*SNClient) Subscribe ¶
func (c *SNClient) Subscribe(topic string, qos byte, mh MessageHandler) *SubscribeToken
func (*SNClient) SubscribePredefined ¶
func (c *SNClient) SubscribePredefined(topicid uint16, qos byte, mh MessageHandler) *SubscribeToken
type SubscribeToken ¶
type SubscribeToken struct { Qos byte TopicName string TopicId uint16 ReturnCode byte // contains filtered or unexported fields }
func (*SubscribeToken) Wait ¶
func (b *SubscribeToken) Wait()
Wait will wait indefinitely for the Token to complete, ie the Publish to be sent and confirmed receipt from the broker
type Token ¶
type UnsubscribeToken ¶
type UnsubscribeToken struct {
// contains filtered or unexported fields
}
func (*UnsubscribeToken) Wait ¶
func (b *UnsubscribeToken) Wait()
Wait will wait indefinitely for the Token to complete, ie the Publish to be sent and confirmed receipt from the broker
Click to show internal directories.
Click to hide internal directories.