Versions in this module Expand all Collapse all v1 v1.2.3 Dec 10, 2022 Changes in this version + var ErrConnectionClosed = errors.New("Connection not open") + type Client struct + AC auth.Controller + CleanSession bool + ID string + Inflight Inflight + LWT LWT + Listener string + ProtocolVersion byte + R *circ.Reader + State State + Subscriptions map[string]packets.SubOptions + TopicAlias map[uint16]string + Username []byte + W *circ.Writer + func NewClient(c net.Conn, r *circ.Reader, w *circ.Writer, s *system.Info, rm int) *Client + func NewClientStub(s *system.Info, rm int) *Client + func (cl *Client) ClearBuffers() + func (cl *Client) ForgetSubscription(filter string) + func (cl *Client) Identify(lid string, pk packets.Packet, ac auth.Controller) + func (cl *Client) Info() events.Client + func (cl *Client) NextPacketID() uint32 + func (cl *Client) NoteSubscription(filter string, so packets.SubOptions) + func (cl *Client) Read(packetHandler func(*Client, packets.Packet) error) error + func (cl *Client) ReadConnectPacket(fh *packets.FixedHeader) (pk packets.Packet, err error) + func (cl *Client) ReadFixedHeader(fh *packets.FixedHeader) error + func (cl *Client) ReadPacket(fh *packets.FixedHeader) (pk packets.Packet, err error) + func (cl *Client) SendInflight(handler func(cl *Client, im *InflightMessage, force bool) error) + func (cl *Client) Start() + func (cl *Client) Stop(err error) + func (cl *Client) StopCause() error + func (cl *Client) WritePacket(pk packets.Packet) (n int, err error) + type Clients struct + func New() *Clients + func (cl *Clients) Add(val *Client) + func (cl *Clients) Delete(id string) + func (cl *Clients) Get(id string) (*Client, bool) + func (cl *Clients) GetAll() map[string]*Client + func (cl *Clients) GetByListener(id string) []*Client + func (cl *Clients) Len() int + type Inflight interface + Delete func(key uint16) bool + Get func(key uint16) (*InflightMessage, bool) + GetAll func() map[uint16]*InflightMessage + Len func() int + Set func(key uint16, in *InflightMessage) bool + Walk func(cl *Client, handler func(cl *Client, im *InflightMessage, force bool) error) + type InflightCache struct + func NewCache(cap uint16) *InflightCache + func (i *InflightCache) Delete(key uint16) bool + func (i *InflightCache) Get(key uint16) (*InflightMessage, bool) + func (i *InflightCache) GetAll() map[uint16]*InflightMessage + func (i *InflightCache) Len() int + func (i *InflightCache) Set(key uint16, in *InflightMessage) bool + func (i *InflightCache) Walk(cl *Client, handler func(cl *Client, im *InflightMessage, force bool) error) + type InflightMap struct + func NewMap(cp int) *InflightMap + func (i *InflightMap) Delete(key uint16) bool + func (i *InflightMap) Get(key uint16) (*InflightMessage, bool) + func (i *InflightMap) GetAll() map[uint16]*InflightMessage + func (i *InflightMap) Len() int + func (i *InflightMap) Set(key uint16, in *InflightMessage) bool + func (i *InflightMap) Walk(cl *Client, handler func(cl *Client, im *InflightMessage, force bool) error) + type InflightMessage struct + Expiry int64 + Packet packets.Packet + Resends int + Sent int64 + type LWT struct + Message []byte + Qos byte + Retain bool + Topic string + type State struct + Done uint32