Versions in this module Expand all Collapse all v0 v0.2.0 Jul 4, 2016 Changes in this version + var ErrClientExpectedConnack = errors.New("client expected connack") + func ClearRetainedMessage(url string, topic string) error + func SessionTest(t *testing.T, builder func() Session) + type MemorySession struct + func NewMemorySession() *MemorySession + func (s *MemorySession) AllPackets(direction string) ([]packet.Packet, error) + func (s *MemorySession) DeletePacket(direction string, id uint16) error + func (s *MemorySession) LookupPacket(direction string, id uint16) (packet.Packet, error) + func (s *MemorySession) PacketID() uint16 + func (s *MemorySession) Reset() error + func (s *MemorySession) SavePacket(direction string, pkt packet.Packet) error + type Session interface + AllPackets func(direction string) ([]packet.Packet, error) + DeletePacket func(direction string, id uint16) error + LookupPacket func(direction string, id uint16) (packet.Packet, error) + PacketID func() uint16 + Reset func() error + SavePacket func(direction string, pkt packet.Packet) error v0.1.0 Feb 14, 2016 Changes in this version + var ErrClientAlreadyConnecting = errors.New("client already connecting") + var ErrClientConnectionDenied = errors.New("client connection denied") + var ErrClientMissingID = errors.New("client missing id") + var ErrClientMissingPong = errors.New("client missing pong") + var ErrClientNotConnected = errors.New("client not connected") + var ErrClientUnexpectedClose = errors.New("client unexpected close") + var ErrFutureCanceled = errors.New("future canceled") + var ErrFutureTimeout = errors.New("future timeout") + func ClearSession(url string, clientID string) error + type Callback func(msg *packet.Message, err error) + type Client struct + Callback Callback + Logger Logger + Session session.Session + func New() *Client + func (c *Client) Close() error + func (c *Client) Connect(urlString string, opts *Options) (*ConnectFuture, error) + func (c *Client) Disconnect(timeout ...time.Duration) error + func (c *Client) Publish(topic string, payload []byte, qos uint8, retain bool) (*PublishFuture, error) + func (c *Client) PublishMessage(msg *packet.Message) (*PublishFuture, error) + func (c *Client) Subscribe(topic string, qos uint8) (*SubscribeFuture, error) + func (c *Client) SubscribeMultiple(subscriptions map[string]uint8) (*SubscribeFuture, error) + func (c *Client) Unsubscribe(topic string) (*UnsubscribeFuture, error) + func (c *Client) UnsubscribeMultiple(topics []string) (*UnsubscribeFuture, error) + type ConnectFuture struct + ReturnCode packet.ConnackCode + SessionPresent bool + func (f *ConnectFuture) Call(callback func(error), timeout ...time.Duration) + func (f *ConnectFuture) Wait(timeout ...time.Duration) error + type Future interface + Call func(func(err error), ...time.Duration) + Wait func(timeout ...time.Duration) error + type Logger func(msg string) + type Message func(msg *packet.Message) + type Offline func() + type Online func(resumed bool) + type Options struct + CleanSession bool + ClientID string + KeepAlive string + Will *packet.Message + func NewOptions() *Options + type PublishFuture struct + func (f *PublishFuture) Call(callback func(error), timeout ...time.Duration) + func (f *PublishFuture) Wait(timeout ...time.Duration) error + type Service struct + ConnectTimeout time.Duration + DisconnectTimeout time.Duration + Logger Logger + MaxReconnectDelay time.Duration + Message Message + MinReconnectDelay time.Duration + Offline Offline + Online Online + Session session.Session + func NewService() *Service + func (s *Service) Publish(topic string, payload []byte, qos uint8, retain bool) *PublishFuture + func (s *Service) Start(url string, opts *Options) + func (s *Service) Stop(clearFutures bool) + func (s *Service) Subscribe(topic string, qos uint8, requeue bool) *SubscribeFuture + func (s *Service) SubscribeMultiple(subscriptions map[string]uint8, requeue bool) *SubscribeFuture + func (s *Service) Unsubscribe(topic string, requeue bool) *UnsubscribeFuture + func (s *Service) UnsubscribeMultiple(topics []string, requeue bool) *UnsubscribeFuture + type SubscribeFuture struct + ReturnCodes []uint8 + func (f *SubscribeFuture) Call(callback func(error), timeout ...time.Duration) + func (f *SubscribeFuture) Wait(timeout ...time.Duration) error + type UnsubscribeFuture struct + func (f *UnsubscribeFuture) Call(callback func(error), timeout ...time.Duration) + func (f *UnsubscribeFuture) Wait(timeout ...time.Duration) error