Versions in this module Expand all Collapse all v1 v1.0.2 May 16, 2024 v1.0.1 Jun 24, 2023 Changes in this version + const Version31 + const Version311 + var ErrInvalidPacketType = errors.New("invalid packet type") + var MaxVarint = uint64(268435455) + func Fuzz(data []byte) int + type Connack struct + ReturnCode ConnackCode + SessionPresent bool + func NewConnack() *Connack + func (c *Connack) Decode(src []byte) (int, error) + func (c *Connack) Encode(dst []byte) (int, error) + func (c *Connack) Len() int + func (c *Connack) String() string + func (c *Connack) Type() Type + type ConnackCode uint8 + const BadUsernameOrPassword + const ConnectionAccepted + const IdentifierRejected + const InvalidProtocolVersion + const NotAuthorized + const ServerUnavailable + func (cc ConnackCode) String() string + func (cc ConnackCode) Valid() bool + type Connect struct + CleanSession bool + ClientID string + KeepAlive uint16 + Password string + Username string + Version byte + Will *Message + func NewConnect() *Connect + func (c *Connect) Decode(src []byte) (int, error) + func (c *Connect) Encode(dst []byte) (int, error) + func (c *Connect) Len() int + func (c *Connect) String() string + func (c *Connect) Type() Type + type Disconnect struct + func NewDisconnect() *Disconnect + func (d *Disconnect) Decode(src []byte) (int, error) + func (d *Disconnect) Encode(dst []byte) (int, error) + func (d *Disconnect) Len() int + func (d *Disconnect) String() string + func (d *Disconnect) Type() Type + type Error struct + Type Type + func (e *Error) Error() string + type Generic interface + Decode func(src []byte) (int, error) + Encode func(dst []byte) (int, error) + Len func() int + String func() string + Type func() Type + type ID uint16 + func GetID(pkt Generic) (ID, bool) + func (id ID) Valid() bool + type Message struct + Payload []byte + QOS QOS + Retain bool + Topic string + func (m *Message) String() string + func (m Message) Copy() *Message + type Pingreq struct + func NewPingreq() *Pingreq + func (p *Pingreq) Decode(src []byte) (int, error) + func (p *Pingreq) Encode(dst []byte) (int, error) + func (p *Pingreq) Len() int + func (p *Pingreq) String() string + func (p *Pingreq) Type() Type + type Pingresp struct + func NewPingresp() *Pingresp + func (p *Pingresp) Decode(src []byte) (int, error) + func (p *Pingresp) Encode(dst []byte) (int, error) + func (p *Pingresp) Len() int + func (p *Pingresp) String() string + func (p *Pingresp) Type() Type + type Puback struct + ID ID + func NewPuback() *Puback + func (p *Puback) Decode(src []byte) (int, error) + func (p *Puback) Encode(dst []byte) (int, error) + func (p *Puback) Len() int + func (p *Puback) String() string + func (p *Puback) Type() Type + type Pubcomp struct + ID ID + func NewPubcomp() *Pubcomp + func (p *Pubcomp) Decode(src []byte) (int, error) + func (p *Pubcomp) Encode(dst []byte) (int, error) + func (p *Pubcomp) Len() int + func (p *Pubcomp) String() string + func (p *Pubcomp) Type() Type + type Publish struct + Dup bool + ID ID + Message Message + func NewPublish() *Publish + func (p *Publish) Decode(src []byte) (int, error) + func (p *Publish) Encode(dst []byte) (int, error) + func (p *Publish) Len() int + func (p *Publish) String() string + func (p *Publish) Type() Type + type Pubrec struct + ID ID + func NewPubrec() *Pubrec + func (p *Pubrec) Decode(src []byte) (int, error) + func (p *Pubrec) Encode(dst []byte) (int, error) + func (p *Pubrec) Len() int + func (p *Pubrec) String() string + func (p *Pubrec) Type() Type + type Pubrel struct + ID ID + func NewPubrel() *Pubrel + func (p *Pubrel) Decode(src []byte) (int, error) + func (p *Pubrel) Encode(dst []byte) (int, error) + func (p *Pubrel) Len() int + func (p *Pubrel) String() string + func (p *Pubrel) Type() Type + type QOS byte + const QOSAtLeastOnce + const QOSAtMostOnce + const QOSExactlyOnce + const QOSFailure + func (qos QOS) Successful() bool + type Suback struct + ID ID + ReturnCodes []QOS + func NewSuback() *Suback + func (s *Suback) Decode(src []byte) (int, error) + func (s *Suback) Encode(dst []byte) (int, error) + func (s *Suback) Len() int + func (s *Suback) String() string + func (s *Suback) Type() Type + type Subscribe struct + ID ID + Subscriptions []Subscription + func NewSubscribe() *Subscribe + func (s *Subscribe) Decode(src []byte) (int, error) + func (s *Subscribe) Encode(dst []byte) (int, error) + func (s *Subscribe) Len() int + func (s *Subscribe) String() string + func (s *Subscribe) Type() Type + type Subscription struct + QOS QOS + Topic string + func (s *Subscription) String() string + type Type byte + const CONNACK + const CONNECT + const DISCONNECT + const PINGREQ + const PINGRESP + const PUBACK + const PUBCOMP + const PUBLISH + const PUBREC + const PUBREL + const SUBACK + const SUBSCRIBE + const UNSUBACK + const UNSUBSCRIBE + func DetectPacket(src []byte) (int, Type) + func Types() []Type + func (t Type) New() (Generic, error) + func (t Type) String() string + func (t Type) Valid() bool + type Unsuback struct + ID ID + func NewUnsuback() *Unsuback + func (u *Unsuback) Decode(src []byte) (int, error) + func (u *Unsuback) Encode(dst []byte) (int, error) + func (u *Unsuback) Len() int + func (u *Unsuback) String() string + func (u *Unsuback) Type() Type + type Unsubscribe struct + ID ID + Topics []string + func NewUnsubscribe() *Unsubscribe + func (u *Unsubscribe) Decode(src []byte) (int, error) + func (u *Unsubscribe) Encode(dst []byte) (int, error) + func (u *Unsubscribe) Len() int + func (u *Unsubscribe) String() string + func (u *Unsubscribe) Type() Type