Documentation ¶
Overview ¶
Copyright 2014, Shuhei Tanuma. All rights reserved. Use of this source code is governed by a MIT license that can be found in the LICENSE file.
Index ¶
- type Client
- func (self *Client) Connect() error
- func (self *Client) Disconnect()
- func (self *Client) Loop()
- func (self *Client) On(event string, callback interface{}, args ...bool) error
- func (self *Client) Publish(TopicName string, Payload []byte, QoSLevel int)
- func (self *Client) PublishWait(TopicName string, Payload []byte, QoSLevel int) error
- func (self *Client) PublishWithRetain(TopicName string, Payload []byte, QoSLevel int)
- func (self *Client) SetRequestPerSecondLimit(limit int)
- func (self *Client) Subscribe(topic string, QoS int) error
- func (self *Client) Terminate()
- func (self *Client) Unsubscribe(topic string)
- func (self *Client) WaitConnection()
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Connection *MyConnection PublishCallback func(string, []byte) Option Option CleanSession bool Subscribed map[string]int Mutex sync.RWMutex Errors chan error Kicker *time.Timer // contains filtered or unexported fields }
func (*Client) Disconnect ¶
func (self *Client) Disconnect()
func (*Client) PublishWait ¶
func (*Client) PublishWithRetain ¶
func (*Client) SetRequestPerSecondLimit ¶
func (*Client) Unsubscribe ¶
func (*Client) WaitConnection ¶
func (self *Client) WaitConnection()
type Option ¶
type Option struct { TransporterCallback func() (net.Conn, error) Magic []byte Version int Identifier string Ticker *time.Ticker TickerCallback func(time.Time, *Client) error WillTopic string WillMessage []byte WillRetain bool WillQos int CleanSession bool UserName string Password string Keepalive int // THIS IS REALLY TROBULESOME Logger log.Logger }
Click to show internal directories.
Click to hide internal directories.