Documentation ¶
Index ¶
- type Client
- func (this *Client) Connect(proto, addr string) (token session.Token, err error)
- func (this *Client) Disconnect() (err error)
- func (this *Client) GetID() string
- func (this *Client) GetKeepalive() uint16
- func (this *Client) Publish(topic string, body []byte, qos byte, retain bool) (token session.Token, err error)
- func (this *Client) SetKeepalive(keepalive uint16)
- func (this *Client) SetOnDisconnected(cb func())
- func (this *Client) SetOnMessage(cb func(topic string, body []byte, qos byte))
- func (this *Client) Subcribe(submap map[string]byte) (token session.Token, err error)
- func (this *Client) Unsubcribe(subs ...string) (token session.Token, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { WillTopic string WillMessage []byte WillQos byte WillRetain bool Keepalive uint16 //second // contains filtered or unexported fields }
func (*Client) Disconnect ¶
func (*Client) GetKeepalive ¶
func (*Client) Publish ¶
func (this *Client) Publish(topic string, body []byte, qos byte, retain bool) (token session.Token, err error)
发布消息
func (*Client) SetKeepalive ¶
func (*Client) SetOnDisconnected ¶
func (this *Client) SetOnDisconnected(cb func())
func (*Client) SetOnMessage ¶
Click to show internal directories.
Click to hide internal directories.