Versions in this module Expand all Collapse all v0 v0.9.0 Mar 23, 2015 Changes in this version + const CLI + const DEC + const ERR + const MES + const MID + const NET + const PNG + const STA + const STR + const TST + var CRITICAL *log.Logger + var DEBUG *log.Logger + var ERROR *log.Logger + var ErrInvalidQos = errors.New("Invalid QoS") + var ErrInvalidTopicEmptyString = errors.New("Invalid Topic; empty string") + var ErrInvalidTopicMultilevel = errors.New("Invalid Topic; multi-level wildcard must be last level") + var ErrNotConnected = errors.New("Not Connected") + var WARN *log.Logger + func DefaultConnectionLostHandler(client *Client, reason error) + type Client struct + func NewClient(o *ClientOptions) *Client + func (c *Client) Connect() Token + func (c *Client) Disconnect(quiesce uint) + func (c *Client) ForceDisconnect() + func (c *Client) IsConnected() bool + func (c *Client) Publish(topic string, qos byte, retained bool, payload interface{}) Token + func (c *Client) Subscribe(topic string, qos byte, callback MessageHandler) Token + func (c *Client) SubscribeMultiple(filters map[string]byte, callback MessageHandler) Token + func (c *Client) Unsubscribe(topics ...string) Token + type ClientInt interface + Connect func() Token + Disconnect func(uint) + ForceDisconnect func() + IsConnected func() bool + Publish func(string, byte, bool, interface{}) Token + Subscribe func(string, byte, MessageHandler) Token + SubscribeMultiple func(map[string]byte, MessageHandler) Token + Unsubscribe func(...string) Token + type ClientOptions struct + AutoReconnect bool + CleanSession bool + ClientID string + DefaultPublishHander MessageHandler + KeepAlive time.Duration + MaxReconnectInterval time.Duration + OnConnect OnConnectHandler + OnConnectionLost ConnectionLostHandler + Order bool + Password string + ProtocolVersion uint + Servers []*url.URL + Store Store + TLSConfig tls.Config + Username string + WillEnabled bool + WillPayload []byte + WillQos byte + WillRetained bool + WillTopic string + WriteTimeout time.Duration + func NewClientOptions() *ClientOptions + func (o *ClientOptions) AddBroker(server string) *ClientOptions + func (o *ClientOptions) SetAutoReconnect(a bool) *ClientOptions + func (o *ClientOptions) SetBinaryWill(topic string, payload []byte, qos byte, retained bool) *ClientOptions + func (o *ClientOptions) SetCleanSession(clean bool) *ClientOptions + func (o *ClientOptions) SetClientID(id string) *ClientOptions + func (o *ClientOptions) SetConnectionLostHandler(onLost ConnectionLostHandler) *ClientOptions + func (o *ClientOptions) SetDefaultPublishHandler(defaultHandler MessageHandler) *ClientOptions + func (o *ClientOptions) SetKeepAlive(k time.Duration) *ClientOptions + func (o *ClientOptions) SetMaxReconnectInterval(t time.Duration) *ClientOptions + func (o *ClientOptions) SetOnConnectHandler(onConn OnConnectHandler) *ClientOptions + func (o *ClientOptions) SetOrderMatters(order bool) *ClientOptions + func (o *ClientOptions) SetPassword(p string) *ClientOptions + func (o *ClientOptions) SetProtocolVersion(pv uint) *ClientOptions + func (o *ClientOptions) SetStore(s Store) *ClientOptions + func (o *ClientOptions) SetTLSConfig(t *tls.Config) *ClientOptions + func (o *ClientOptions) SetUsername(u string) *ClientOptions + func (o *ClientOptions) SetWill(topic string, payload string, qos byte, retained bool) *ClientOptions + func (o *ClientOptions) SetWriteTimeout(t time.Duration) *ClientOptions + func (o *ClientOptions) UnsetWill() *ClientOptions + type ConnectToken struct + func (b *ConnectToken) Error() error + func (b *ConnectToken) Wait() bool + func (b *ConnectToken) WaitTimeout(d time.Duration) bool + func (c *ConnectToken) ReturnCode() byte + type ConnectionLostHandler func(*Client, error) + type DisconnectToken struct + func (b *DisconnectToken) Error() error + func (b *DisconnectToken) Wait() bool + func (b *DisconnectToken) WaitTimeout(d time.Duration) bool + type FileStore struct + func NewFileStore(directory string) *FileStore + func (store *FileStore) All() []string + func (store *FileStore) Close() + func (store *FileStore) Del(key string) + func (store *FileStore) Get(key string) packets.ControlPacket + func (store *FileStore) Open() + func (store *FileStore) Put(key string, m packets.ControlPacket) + func (store *FileStore) Reset() + type MId uint16 + type MemoryStore struct + func NewMemoryStore() *MemoryStore + func (store *MemoryStore) All() []string + func (store *MemoryStore) Close() + func (store *MemoryStore) Del(key string) + func (store *MemoryStore) Get(key string) packets.ControlPacket + func (store *MemoryStore) Open() + func (store *MemoryStore) Put(key string, message packets.ControlPacket) + func (store *MemoryStore) Reset() + type Message interface + Duplicate func() bool + MessageID func() uint16 + Payload func() []byte + Qos func() byte + Retained func() bool + Topic func() string + type MessageHandler func(*Client, Message) + type OnConnectHandler func(*Client) + type PacketAndToken struct + type PublishToken struct + func (b *PublishToken) Error() error + func (b *PublishToken) Wait() bool + func (b *PublishToken) WaitTimeout(d time.Duration) bool + func (p *PublishToken) MessageID() uint16 + type Store interface + All func() []string + Close func() + Del func(string) + Get func(string) packets.ControlPacket + Open func() + Put func(string, packets.ControlPacket) + Reset func() + type SubscribeToken struct + func (b *SubscribeToken) Error() error + func (b *SubscribeToken) Wait() bool + func (b *SubscribeToken) WaitTimeout(d time.Duration) bool + func (s *SubscribeToken) Result() map[string]byte + type Token interface + Error func() error + Wait func() bool + WaitTimeout func(time.Duration) bool + type UnsubscribeToken struct + func (b *UnsubscribeToken) Error() error + func (b *UnsubscribeToken) Wait() bool + func (b *UnsubscribeToken) WaitTimeout(d time.Duration) bool