packet

package
v0.0.2-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PropertyPayloadFormat                   = PropertyID(0x01)
	PropertyPublicationExpiry               = PropertyID(0x02)
	PropertyContentType                     = PropertyID(0x03)
	PropertyResponseTopic                   = PropertyID(0x08)
	PropertyCorrelationData                 = PropertyID(0x09)
	PropertySubscriptionIdentifier          = PropertyID(0x0B)
	PropertySessionExpiryInterval           = PropertyID(0x11)
	PropertyAssignedClientIdentifier        = PropertyID(0x12)
	PropertyServerKeepAlive                 = PropertyID(0x13)
	PropertyAuthMethod                      = PropertyID(0x15)
	PropertyAuthData                        = PropertyID(0x16)
	PropertyRequestProblemInfo              = PropertyID(0x17)
	PropertyWillDelayInterval               = PropertyID(0x18)
	PropertyRequestResponseInfo             = PropertyID(0x19)
	PropertyResponseInfo                    = PropertyID(0x1A)
	PropertyServerReverence                 = PropertyID(0x1C)
	PropertyReasonString                    = PropertyID(0x1F)
	PropertyReceiveMaximum                  = PropertyID(0x21)
	PropertyTopicAliasMaximum               = PropertyID(0x22)
	PropertyTopicAlias                      = PropertyID(0x23)
	PropertyMaximumQoS                      = PropertyID(0x24)
	PropertyRetainAvailable                 = PropertyID(0x25)
	PropertyUserProperty                    = PropertyID(0x26)
	PropertyMaximumPacketSize               = PropertyID(0x27)
	PropertyWildcardSubscriptionAvailable   = PropertyID(0x28)
	PropertySubscriptionIdentifierAvailable = PropertyID(0x29)
	PropertySharedSubscriptionAvailable     = PropertyID(0x2A)
)

nolint: golint

View Source
const (
	PropertyTypeByte = iota
	PropertyTypeShort
	PropertyTypeInt
	PropertyTypeVarInt
	PropertyTypeString
	PropertyTypeStringPair
	PropertyTypeBinary
)

nolint: golint

View Source
const (
	// ProtocolV31 describes spec MQIsdp
	ProtocolV31 = ProtocolVersion(0x3)
	// ProtocolV311 describes spec v3.1.1
	ProtocolV311 = ProtocolVersion(0x4)
	// ProtocolV50 describes spec v5.0
	ProtocolV50 = ProtocolVersion(0x5)
)
View Source
const (
	// MaxLPString maximum size of length-prefixed string
	MaxLPString = 65535
)

Variables

View Source
var SupportedVersions = map[ProtocolVersion]string{
	ProtocolV31:  "MQIsdp",
	ProtocolV311: "MQTT",
	ProtocolV50:  "MQTT",
}

SupportedVersions is a map of the version number (0x3 or 0x4) to the version string, "MQIsdp" for 0x3, and "MQTT" for 0x4.

Functions

func ReadLPBytes

func ReadLPBytes(buf []byte) ([]byte, int, error)

ReadLPBytes read length prefixed bytes

func ValidTopic

func ValidTopic(topic string) bool

ValidTopic checks the topic, which is a slice of bytes, to see if it's valid. Topic is considered valid if it's longer than 0 bytes, and doesn't contain any wildcard characters such as + and #.

func WriteLPBytes

func WriteLPBytes(buf []byte, b []byte) (int, error)

WriteLPBytes write length prefixed bytes

Types

type Ack

type Ack struct {
	// contains filtered or unexported fields
}

Ack acknowledge packets for PUBLISH messages A PUBACK Packet is the response to a PUBLISH Packet with QoS level 1 A PUBREC/PUBREL/PUBCOMP Packet is the response to a PUBLISH Packet with QoS level 2

func (*Ack) Desc

func (h *Ack) Desc() string

Desc returns a string description of the message type. For example, a CONNECT message would return "Client request to connect to Server." These descriptions are statically defined (copied from the MQTT spec) and cannot be changed.

func (*Ack) Encode

func (h *Ack) Encode(dst []byte) (int, error)

func (*Ack) Flags

func (h *Ack) Flags() byte

Flags returns the fixed header flags for this message.

func (*Ack) ID

func (h *Ack) ID() (IDType, error)

func (*Ack) Name

func (h *Ack) Name() string

Name returns a string representation of the message type. Examples include "PUBLISH", "SUBSCRIBE", and others. This is statically defined for each of the message types and cannot be changed.

func (*Ack) PropertyForEach

func (h *Ack) PropertyForEach(f func(PropertyID, interface{})) error

func (*Ack) PropertyGet

func (h *Ack) PropertyGet(id PropertyID) (interface{}, error)

func (*Ack) PropertySet

func (h *Ack) PropertySet(id PropertyID, val interface{}) error

func (*Ack) Reason

func (msg *Ack) Reason() ReasonCode

Reason return acknowledgment reason

func (*Ack) RemainingLength

func (h *Ack) RemainingLength() int32

RemainingLength returns the length of the non-fixed-header part of the message.

func (*Ack) SetPacketID

func (msg *Ack) SetPacketID(v IDType)

SetPacketID sets the ID of the packet.

func (*Ack) SetReason

func (msg *Ack) SetReason(c ReasonCode)

SetReason of acknowledgment

func (*Ack) SetVersion

func (h *Ack) SetVersion(v ProtocolVersion)

func (*Ack) Size

func (h *Ack) Size() (int, error)

Size of message

func (*Ack) Type

func (h *Ack) Type() Type

Type returns the MessageType of the Message

func (*Ack) Version

func (h *Ack) Version() ProtocolVersion

type Auth

type Auth struct {
	// contains filtered or unexported fields
}

Auth The CONNACK Packet is the packet sent by the Server in response to a CONNECT Packet received from a Client. The first packet sent from the Server to the Client MUST be a CONNACK Packet [MQTT-3.2.0-1]. If the Client does not receive a CONNACK Packet from the Server within a reasonable amount of time, the Client SHOULD close the Network Connection. A "reasonable" amount of time depends on the type of application and the communications infrastructure.

func (*Auth) Desc

func (h *Auth) Desc() string

Desc returns a string description of the message type. For example, a CONNECT message would return "Client request to connect to Server." These descriptions are statically defined (copied from the MQTT spec) and cannot be changed.

func (*Auth) Encode

func (h *Auth) Encode(dst []byte) (int, error)

func (*Auth) Flags

func (h *Auth) Flags() byte

Flags returns the fixed header flags for this message.

func (*Auth) ID

func (h *Auth) ID() (IDType, error)

func (*Auth) Name

func (h *Auth) Name() string

Name returns a string representation of the message type. Examples include "PUBLISH", "SUBSCRIBE", and others. This is statically defined for each of the message types and cannot be changed.

func (*Auth) PropertyForEach

func (h *Auth) PropertyForEach(f func(PropertyID, interface{})) error

func (*Auth) PropertyGet

func (h *Auth) PropertyGet(id PropertyID) (interface{}, error)

func (*Auth) PropertySet

func (h *Auth) PropertySet(id PropertyID, val interface{}) error

func (*Auth) ReasonCode

func (msg *Auth) ReasonCode() ReasonCode

ReasonCode get authentication reason

func (*Auth) RemainingLength

func (h *Auth) RemainingLength() int32

RemainingLength returns the length of the non-fixed-header part of the message.

func (*Auth) SetReasonCode

func (msg *Auth) SetReasonCode(c ReasonCode) error

SetReasonCode set authentication reason code

func (*Auth) SetVersion

func (h *Auth) SetVersion(v ProtocolVersion)

func (*Auth) Size

func (h *Auth) Size() (int, error)

Size of message

func (*Auth) Type

func (h *Auth) Type() Type

Type returns the MessageType of the Message

func (*Auth) Version

func (h *Auth) Version() ProtocolVersion

type CodeIssuer

type CodeIssuer byte

CodeIssuer who is message issuer

const (
	CodeIssuerServer CodeIssuer = 0x00
	CodeIssuerClient
	CodeIssuerBoth
	CodeIssuerInvalid
)

nolint: golint

type ConnAck

type ConnAck struct {
	// contains filtered or unexported fields
}

ConnAck The CONNACK Packet is the packet sent by the Server in response to a CONNECT Packet received from a Client. The first packet sent from the Server to the Client MUST be a CONNACK Packet [MQTT-3.2.0-1]. If the Client does not receive a CONNACK Packet from the Server within a reasonable amount of time, the Client SHOULD close the Network Connection. A "reasonable" amount of time depends on the type of application and the communications infrastructure.

func (*ConnAck) Desc

func (h *ConnAck) Desc() string

Desc returns a string description of the message type. For example, a CONNECT message would return "Client request to connect to Server." These descriptions are statically defined (copied from the MQTT spec) and cannot be changed.

func (*ConnAck) Encode

func (h *ConnAck) Encode(dst []byte) (int, error)

func (*ConnAck) Flags

func (h *ConnAck) Flags() byte

Flags returns the fixed header flags for this message.

func (*ConnAck) ID

func (h *ConnAck) ID() (IDType, error)

func (*ConnAck) Name

func (h *ConnAck) Name() string

Name returns a string representation of the message type. Examples include "PUBLISH", "SUBSCRIBE", and others. This is statically defined for each of the message types and cannot be changed.

func (*ConnAck) PropertyForEach

func (h *ConnAck) PropertyForEach(f func(PropertyID, interface{})) error

func (*ConnAck) PropertyGet

func (h *ConnAck) PropertyGet(id PropertyID) (interface{}, error)

func (*ConnAck) PropertySet

func (h *ConnAck) PropertySet(id PropertyID, val interface{}) error

func (*ConnAck) RemainingLength

func (h *ConnAck) RemainingLength() int32

RemainingLength returns the length of the non-fixed-header part of the message.

func (*ConnAck) ReturnCode

func (msg *ConnAck) ReturnCode() ReasonCode

ReturnCode returns the return code received for the CONNECT message. The return type is an error

func (*ConnAck) SessionPresent

func (msg *ConnAck) SessionPresent() bool

SessionPresent returns the session present flag value

func (*ConnAck) SetReturnCode

func (msg *ConnAck) SetReturnCode(ret ReasonCode) error

SetReturnCode of conn

func (*ConnAck) SetSessionPresent

func (msg *ConnAck) SetSessionPresent(v bool)

SetSessionPresent sets the value of the session present flag

func (*ConnAck) SetVersion

func (h *ConnAck) SetVersion(v ProtocolVersion)

func (*ConnAck) Size

func (h *ConnAck) Size() (int, error)

Size of message

func (*ConnAck) Type

func (h *ConnAck) Type() Type

Type returns the MessageType of the Message

func (*ConnAck) Version

func (h *ConnAck) Version() ProtocolVersion

type Connect

type Connect struct {
	// contains filtered or unexported fields
}

Connect After a Network Connection is established by a Client to a Server, the first Packet sent from the Client to the Server MUST be a CONNECT Packet [MQTT-3.1.0-1].

A Client can only send the CONNECT Packet once over a Network Connection. The Server MUST process a second CONNECT Packet sent from a Client as a protocol violation and disconnect the Client [MQTT-3.1.0-2]. See section 4.8 for information about handling errors.

func (*Connect) CleanStart

func (msg *Connect) CleanStart() bool

CleanStart returns the bit that specifies the handling of the Session state. The Client and Server can store Session state to enable reliable messaging to continue across a sequence of Network Connections. This bit is used to control the lifetime of the Session state.

func (*Connect) ClientID

func (msg *Connect) ClientID() []byte

ClientID returns an ID that identifies the Client to the Server. Each Client connecting to the Server has a unique ClientId. The ClientId MUST be used by Clients and by Servers to identify state that they hold relating to this MQTT Session between the Client and the Server

func (*Connect) Credentials

func (msg *Connect) Credentials() ([]byte, []byte)

Credentials returns user and password

func (*Connect) Desc

func (h *Connect) Desc() string

Desc returns a string description of the message type. For example, a CONNECT message would return "Client request to connect to Server." These descriptions are statically defined (copied from the MQTT spec) and cannot be changed.

func (*Connect) Encode

func (h *Connect) Encode(dst []byte) (int, error)

func (*Connect) Flags

func (h *Connect) Flags() byte

Flags returns the fixed header flags for this message.

func (*Connect) ID

func (h *Connect) ID() (IDType, error)

func (*Connect) KeepAlive

func (msg *Connect) KeepAlive() uint16

KeepAlive returns a time interval measured in seconds. Expressed as a 16-bit word, it is the maximum time interval that is permitted to elapse between the point at which the Client finishes transmitting one Control Packet and the point it starts sending the next.

func (*Connect) Name

func (h *Connect) Name() string

Name returns a string representation of the message type. Examples include "PUBLISH", "SUBSCRIBE", and others. This is statically defined for each of the message types and cannot be changed.

func (*Connect) PropertyForEach

func (h *Connect) PropertyForEach(f func(PropertyID, interface{})) error

func (*Connect) PropertyGet

func (h *Connect) PropertyGet(id PropertyID) (interface{}, error)

func (*Connect) PropertySet

func (h *Connect) PropertySet(id PropertyID, val interface{}) error

func (*Connect) RemainingLength

func (h *Connect) RemainingLength() int32

RemainingLength returns the length of the non-fixed-header part of the message.

func (*Connect) ResetWill

func (msg *Connect) ResetWill()

ResetWill reset will state of message

func (*Connect) SetCleanStart

func (msg *Connect) SetCleanStart(v bool)

SetCleanStart sets the bit that specifies the handling of the Session state.

func (*Connect) SetClientID

func (msg *Connect) SetClientID(v []byte) error

SetClientID sets an ID that identifies the Client to the Server.

func (*Connect) SetCredentials

func (msg *Connect) SetCredentials(u []byte, p []byte) error

SetCredentials set username and password

func (*Connect) SetKeepAlive

func (msg *Connect) SetKeepAlive(v uint16)

SetKeepAlive sets the time interval in which the server should keep the connection alive.

func (*Connect) SetVersion

func (h *Connect) SetVersion(v ProtocolVersion)

func (*Connect) SetWill

func (msg *Connect) SetWill(t string, m []byte, qos QosType, retain bool) error

SetWill state of message

func (*Connect) Size

func (h *Connect) Size() (int, error)

Size of message

func (*Connect) Type

func (h *Connect) Type() Type

Type returns the MessageType of the Message

func (*Connect) Version

func (h *Connect) Version() ProtocolVersion

func (*Connect) Will

func (msg *Connect) Will() (string, []byte, QosType, bool, bool)

Will returns the topic in which the Will Message should be published to. If the Will Flag is set to 1, the Will Topic must be in the payload. returns will topic, will message, will qos , will retain, will if last param is false will is not set

type Disconnect

type Disconnect struct {
	// contains filtered or unexported fields
}

Disconnect The DISCONNECT Packet is the final Control Packet sent from the Client to the Server. It indicates that the Client is disconnecting cleanly.

func (*Disconnect) Desc

func (h *Disconnect) Desc() string

Desc returns a string description of the message type. For example, a CONNECT message would return "Client request to connect to Server." These descriptions are statically defined (copied from the MQTT spec) and cannot be changed.

func (*Disconnect) Encode

func (h *Disconnect) Encode(dst []byte) (int, error)

func (*Disconnect) Flags

func (h *Disconnect) Flags() byte

Flags returns the fixed header flags for this message.

func (*Disconnect) ID

func (h *Disconnect) ID() (IDType, error)

func (*Disconnect) Name

func (h *Disconnect) Name() string

Name returns a string representation of the message type. Examples include "PUBLISH", "SUBSCRIBE", and others. This is statically defined for each of the message types and cannot be changed.

func (*Disconnect) PropertyForEach

func (h *Disconnect) PropertyForEach(f func(PropertyID, interface{})) error

func (*Disconnect) PropertyGet

func (h *Disconnect) PropertyGet(id PropertyID) (interface{}, error)

func (*Disconnect) PropertySet

func (h *Disconnect) PropertySet(id PropertyID, val interface{}) error

func (*Disconnect) ReasonCode

func (msg *Disconnect) ReasonCode() ReasonCode

ReasonCode get disconnect reason

func (*Disconnect) RemainingLength

func (h *Disconnect) RemainingLength() int32

RemainingLength returns the length of the non-fixed-header part of the message.

func (*Disconnect) SetReasonCode

func (msg *Disconnect) SetReasonCode(c ReasonCode)

SetReasonCode set disconnect reason

func (*Disconnect) SetVersion

func (h *Disconnect) SetVersion(v ProtocolVersion)

func (*Disconnect) Size

func (h *Disconnect) Size() (int, error)

Size of message

func (*Disconnect) Type

func (h *Disconnect) Type() Type

Type returns the MessageType of the Message

func (*Disconnect) Version

func (h *Disconnect) Version() ProtocolVersion

type Error

type Error byte

Error errors

const (
	// ErrInvalidUnSubscribe Invalid UNSUBSCRIBE message
	ErrInvalidUnSubscribe Error = iota
	// ErrInvalidUnSubAck Invalid UNSUBACK message
	ErrInvalidUnSubAck
	// ErrPackedIDNotMatched Packet ID does not match
	ErrDupViolation
	ErrPackedIDNotMatched
	ErrInvalid
	// ErrPackedIDZero cannot be 0
	ErrPackedIDZero
	// ErrOnPublishNil Publisher is nil
	ErrOnPublishNil
	// ErrInvalidMessageType Invalid message type
	ErrInvalidMessageType
	// ErrInvalidMessageTypeFlags Invalid message flags
	ErrInvalidMessageTypeFlags
	// ErrInvalidQoS Invalid message QoS
	ErrInvalidQoS
	// ErrInvalidLength Invalid message length
	ErrInvalidLength
	// ErrProtocolViolation Message Will violation
	ErrProtocolViolation
	// ErrInsufficientBufferSize Insufficient buffer size
	ErrInsufficientBufferSize
	// ErrInsufficientDataSize
	ErrInsufficientDataSize
	// ErrInvalidTopic Topic is empty
	ErrInvalidTopic
	// ErrEmptyPayload Payload is empty
	ErrEmptyPayload
	// ErrInvalidReturnCode invalid return code
	ErrInvalidReturnCode
	// ErrUnimplemented method not implemented
	ErrUnimplemented
	// ErrInvalidLPStringSize LP string size is bigger than expected
	ErrInvalidLPStringSize
	// ErrMalformedTopic topic string is not UTF8
	ErrMalformedTopic
	ErrMalformedStream
	ErrInvalidProtocolVersion
	ErrNotSet
	ErrPanicDetected
	ErrInvalidArgs
	ErrInvalidUtf8
	ErrNotSupported
	ErrProtocolInvalidName
)

nolint: golint

func (Error) Error

func (e Error) Error() string

Error returns the corresponding error string for the ConnAckCode

type IDType

type IDType uint16

IDType as per [MQTT-2.2.1]

type KVPair

type KVPair struct {
	Key   string
	Value string
}

KVPair user defined properties

type PingReq

type PingReq struct {
	// contains filtered or unexported fields
}

PingReq The PINGREQ Packet is sent from a Client to the Server. It can be used to:

  1. Indicate to the Server that the Client is alive in the absence of any other Control Packets being sent from the Client to the Server.
  2. Request that the Server responds to confirm that it is alive.
  3. Exercise the network to indicate that the Network Connection is active.

func (*PingReq) Desc

func (h *PingReq) Desc() string

Desc returns a string description of the message type. For example, a CONNECT message would return "Client request to connect to Server." These descriptions are statically defined (copied from the MQTT spec) and cannot be changed.

func (*PingReq) Encode

func (h *PingReq) Encode(dst []byte) (int, error)

func (*PingReq) Flags

func (h *PingReq) Flags() byte

Flags returns the fixed header flags for this message.

func (*PingReq) ID

func (h *PingReq) ID() (IDType, error)

func (*PingReq) Name

func (h *PingReq) Name() string

Name returns a string representation of the message type. Examples include "PUBLISH", "SUBSCRIBE", and others. This is statically defined for each of the message types and cannot be changed.

func (*PingReq) PropertyForEach

func (h *PingReq) PropertyForEach(f func(PropertyID, interface{})) error

func (*PingReq) PropertyGet

func (h *PingReq) PropertyGet(id PropertyID) (interface{}, error)

func (*PingReq) PropertySet

func (h *PingReq) PropertySet(id PropertyID, val interface{}) error

func (*PingReq) RemainingLength

func (h *PingReq) RemainingLength() int32

RemainingLength returns the length of the non-fixed-header part of the message.

func (*PingReq) SetVersion

func (h *PingReq) SetVersion(v ProtocolVersion)

func (*PingReq) Size

func (h *PingReq) Size() (int, error)

Size of message

func (*PingReq) Type

func (h *PingReq) Type() Type

Type returns the MessageType of the Message

func (*PingReq) Version

func (h *PingReq) Version() ProtocolVersion

type PingResp

type PingResp struct {
	// contains filtered or unexported fields
}

PingResp A PINGRESP Packet is sent by the Server to the Client in response to a PINGREQ Packet. It indicates that the Server is alive.

func (*PingResp) Desc

func (h *PingResp) Desc() string

Desc returns a string description of the message type. For example, a CONNECT message would return "Client request to connect to Server." These descriptions are statically defined (copied from the MQTT spec) and cannot be changed.

func (*PingResp) Encode

func (h *PingResp) Encode(dst []byte) (int, error)

func (*PingResp) Flags

func (h *PingResp) Flags() byte

Flags returns the fixed header flags for this message.

func (*PingResp) ID

func (h *PingResp) ID() (IDType, error)

func (*PingResp) Name

func (h *PingResp) Name() string

Name returns a string representation of the message type. Examples include "PUBLISH", "SUBSCRIBE", and others. This is statically defined for each of the message types and cannot be changed.

func (*PingResp) PropertyForEach

func (h *PingResp) PropertyForEach(f func(PropertyID, interface{})) error

func (*PingResp) PropertyGet

func (h *PingResp) PropertyGet(id PropertyID) (interface{}, error)

func (*PingResp) PropertySet

func (h *PingResp) PropertySet(id PropertyID, val interface{}) error

func (*PingResp) RemainingLength

func (h *PingResp) RemainingLength() int32

RemainingLength returns the length of the non-fixed-header part of the message.

func (*PingResp) SetVersion

func (h *PingResp) SetVersion(v ProtocolVersion)

func (*PingResp) Size

func (h *PingResp) Size() (int, error)

Size of message

func (*PingResp) Type

func (h *PingResp) Type() Type

Type returns the MessageType of the Message

func (*PingResp) Version

func (h *PingResp) Version() ProtocolVersion

type PropertyError

type PropertyError int

PropertyError encodes property error

const (
	ErrPropertyNotFound PropertyError = iota
	ErrPropertyInvalidID
	ErrPropertyPacketTypeMismatch
	ErrPropertyTypeMismatch
	ErrPropertyDuplicate
	ErrPropertyUnsupported
)

nolint: golint

func (PropertyError) Error

func (e PropertyError) Error() string

Error

type PropertyID

type PropertyID uint32

PropertyID id as per [MQTT-2.2.2]

func (PropertyID) DupAllowed

func (p PropertyID) DupAllowed() bool

DupAllowed check if property id allows keys duplication

func (PropertyID) IsValid

func (p PropertyID) IsValid() bool

IsValid check if property id is valid spec value

func (PropertyID) IsValidPacketType

func (p PropertyID) IsValidPacketType(t Type) bool

IsValidPacketType check either property id can be used for given packet type

type PropertyType

type PropertyType byte

PropertyType value type used be property ID

type ProtocolVersion

type ProtocolVersion byte

ProtocolVersion describes versions implemented by this package

func (ProtocolVersion) IsValid

func (p ProtocolVersion) IsValid() bool

IsValid check if protocol version is valid for this implementation

type Provider

type Provider interface {
	// Desc returns a string description of the message type. For example, a
	// CONNECT message would return "Client request to connect to Server." These
	// descriptions are statically defined (copied from the MQTT spec) and cannot
	// be changed.
	Desc() string

	// Type returns the MessageType of the Message. The returned value should be one
	// of the constants defined for MessageType.
	Type() Type

	// IDType returns packet id
	// if has not been set return ErrNotSet
	ID() (IDType, error)

	// Encode writes the message bytes into the byte array from the argument. It
	// returns the number of bytes encoded and whether there's any errors along
	// the way. If there's any errors, then the byte slice and count should be
	// considered invalid.
	Encode([]byte) (int, error)

	// Size of whole message
	Size() (int, error)

	// SetVersion set protocol version used by message
	SetVersion(v ProtocolVersion)

	// Version get protocol version used by message
	Version() ProtocolVersion

	PropertyGet(PropertyID) (interface{}, error)

	PropertySet(PropertyID, interface{}) error

	PropertyForEach(func(PropertyID, interface{})) error
	// contains filtered or unexported methods
}

Provider is an interface defined for all MQTT message types.

func Decode

func Decode(v ProtocolVersion, buf []byte) (msg Provider, total int, err error)

Decode buf into message and return Provider type

func NewMessage

func NewMessage(v ProtocolVersion, t Type) (Provider, error)

NewMessage creates a new message based on the message type. It is a shortcut to call one of the New*Message functions. If an error is returned then the message type is invalid.

type Publish

type Publish struct {
	// contains filtered or unexported fields
}

Publish A PUBLISH Control Packet is sent from a Client to a Server or from Server to a Client to transport an Application Message.

func (*Publish) Desc

func (h *Publish) Desc() string

Desc returns a string description of the message type. For example, a CONNECT message would return "Client request to connect to Server." These descriptions are statically defined (copied from the MQTT spec) and cannot be changed.

func (*Publish) Dup

func (msg *Publish) Dup() bool

Dup returns the value specifying the duplicate delivery of a PUBLISH Control Packet. If the DUP flag is set to 0, it indicates that this is the first occasion that the Client or Server has attempted to send this MQTT PUBLISH Packet. If the DUP flag is set to 1, it indicates that this might be re-delivery of an earlier attempt to send the Packet.

func (*Publish) Encode

func (h *Publish) Encode(dst []byte) (int, error)

func (*Publish) Flags

func (h *Publish) Flags() byte

Flags returns the fixed header flags for this message.

func (*Publish) ID

func (h *Publish) ID() (IDType, error)

func (*Publish) Name

func (h *Publish) Name() string

Name returns a string representation of the message type. Examples include "PUBLISH", "SUBSCRIBE", and others. This is statically defined for each of the message types and cannot be changed.

func (*Publish) Payload

func (msg *Publish) Payload() []byte

Payload returns the application message that's part of the PUBLISH message.

func (*Publish) PropertyForEach

func (h *Publish) PropertyForEach(f func(PropertyID, interface{})) error

func (*Publish) PropertyGet

func (h *Publish) PropertyGet(id PropertyID) (interface{}, error)

func (*Publish) PropertySet

func (h *Publish) PropertySet(id PropertyID, val interface{}) error

func (*Publish) QoS

func (msg *Publish) QoS() QosType

QoS returns the field that indicates the level of assurance for delivery of an Application Message. The values are QoS0, QoS1 and QoS2.

func (*Publish) RemainingLength

func (h *Publish) RemainingLength() int32

RemainingLength returns the length of the non-fixed-header part of the message.

func (*Publish) Retain

func (msg *Publish) Retain() bool

Retain returns the value of the RETAIN flag. This flag is only used on the PUBLISH Packet. If the RETAIN flag is set to 1, in a PUBLISH Packet sent by a Client to a Server, the Server MUST store the Application Message and its QoS, so that it can be delivered to future subscribers whose subscriptions match its topic name.

func (*Publish) Set

func (msg *Publish) Set(t string, p []byte, q QosType, r bool, d bool) error

Set topic/payload/qos/retained/bool

func (*Publish) SetDup

func (msg *Publish) SetDup(v bool)

SetDup sets the value specifying the duplicate delivery of a PUBLISH Control Packet.

func (*Publish) SetPacketID

func (msg *Publish) SetPacketID(v IDType)

SetPacketID sets the ID of the packet.

func (*Publish) SetPayload

func (msg *Publish) SetPayload(v []byte)

SetPayload sets the application message that's part of the PUBLISH message.

func (*Publish) SetQoS

func (msg *Publish) SetQoS(v QosType) error

SetQoS sets the field that indicates the level of assurance for delivery of an Application Message. The values are QoS0, QoS1 and QoS2. An error is returned if the value is not one of these.

func (*Publish) SetRetain

func (msg *Publish) SetRetain(v bool)

SetRetain sets the value of the RETAIN flag.

func (*Publish) SetTopic

func (msg *Publish) SetTopic(v string) error

SetTopic sets the the topic name that identifies the information channel to which payload data is published. An error is returned if ValidTopic() is falbase.

func (*Publish) SetVersion

func (h *Publish) SetVersion(v ProtocolVersion)

func (*Publish) Size

func (h *Publish) Size() (int, error)

Size of message

func (*Publish) Topic

func (msg *Publish) Topic() string

Topic returns the the topic name that identifies the information channel to which payload data is published.

func (*Publish) Type

func (h *Publish) Type() Type

Type returns the MessageType of the Message

func (*Publish) Version

func (h *Publish) Version() ProtocolVersion

type QosType

type QosType byte

QosType QoS type

const (
	// QoS0 At most once delivery
	// The message is delivered according to the capabilities of the underlying network.
	// No response is sent by the receiver and no retry is performed by the sender. The
	// message arrives at the receiver either once or not at all.
	QoS0 QosType = iota

	// QoS1 At least once delivery
	// This quality of service ensures that the message arrives at the receiver at least once.
	// A QoS 1 PUBLISH Packet has a Packet Identifier in its variable header and is acknowledged
	// by a PUBACK Packet. Section 2.3.1 provides more information about Packet Identifiers.
	QoS1

	// QoS2 Exactly once delivery
	// This is the highest quality of service, for use when neither loss nor duplication of
	// messages are acceptable. There is an increased overhead associated with this quality of
	// service.
	QoS2

	// QosFailure is a return value for a subscription if there's a problem while subscribing
	// to a specific topic.
	QosFailure = 0x80
)

func (QosType) Desc

func (c QosType) Desc() string

Desc get string representation of QoS value

func (QosType) IsValid

func (c QosType) IsValid() bool

IsValid checks the QoS value to see if it's valid. Valid QoS are QoS0, QoS1, and QoS2.

func (QosType) IsValidFull

func (c QosType) IsValidFull() bool

IsValidFull checks the QoS value to see if it's valid. Valid QoS are QoS0, QoS1, QoS2 and QosFailure.

type ReasonCode

type ReasonCode byte

ReasonCode contains return codes across all MQTT specs

const (
	CodeSuccess                            ReasonCode = 0x00 //    |   \    |
	CodeRefusedUnacceptableProtocolVersion ReasonCode = 0x01 //    |   \    |
	CodeRefusedIdentifierRejected          ReasonCode = 0x02 //    |   \    |
	CodeRefusedServerUnavailable           ReasonCode = 0x03 //    |   \    |
	CodeRefusedBadUsernameOrPassword       ReasonCode = 0x04 //    |   \    |
	CodeRefusedNotAuthorized               ReasonCode = 0x05 // <--|   \    |
	//CodeDisconnectWithWillMessage          ReasonCode = 0x04 //        \    |
	CodeNoMatchingSubscribers             ReasonCode = 0x10 //        \    |
	CodeNoSubscriptionExisted             ReasonCode = 0x11 //        \    |
	CodeContinueAuthentication            ReasonCode = 0x18 //        \    |
	CodeReAuthenticate                    ReasonCode = 0x19 //        \    |
	CodeUnspecifiedError                  ReasonCode = 0x80 //        \    |
	CodeMalformedPacket                   ReasonCode = 0x81 //        \    |
	CodeProtocolError                     ReasonCode = 0x82 //        \    |
	CodeImplementationSpecificError       ReasonCode = 0x83 //        \    |
	CodeUnsupportedProtocol               ReasonCode = 0x84 //        \    |
	CodeInvalidClientID                   ReasonCode = 0x85 //        \    |
	CodeBadUserOrPassword                 ReasonCode = 0x86 //        \    |
	CodeNotAuthorized                     ReasonCode = 0x87 //        \    |
	CodeServerUnavailable                 ReasonCode = 0x88 //        \    |
	CodeServerBusy                        ReasonCode = 0x89 //        \    |
	CodeBanned                            ReasonCode = 0x8A //        \    |
	CodeServerShuttingDown                ReasonCode = 0x8B //        \    |
	CodeBadAuthMethod                     ReasonCode = 0x8C //        \    |
	CodeKeepAliveTimeout                  ReasonCode = 0x8D //        \    |
	CodeSessionTakenOver                  ReasonCode = 0x8E //        \    |
	CodeInvalidTopicFilter                ReasonCode = 0x8F //        \    |
	CodeInvalidTopicName                  ReasonCode = 0x90 //        \    |
	CodePacketIDInUse                     ReasonCode = 0x91 //        \    |
	CodePacketIDNotFound                  ReasonCode = 0x92 //        \    |
	CodeReceiveMaximumExceeded            ReasonCode = 0x93 //        \    |
	CodeInvalidTopicAlias                 ReasonCode = 0x94 //        \    |
	CodePacketTooLarge                    ReasonCode = 0x95 //        \    |
	CodeMessageRateTooHigh                ReasonCode = 0x96 //        \    |
	CodeQuotaExceeded                     ReasonCode = 0x97 //        \    |
	CodeAdministrativeAction              ReasonCode = 0x98 //        \    |
	CodeInvalidPayloadFormat              ReasonCode = 0x99 //        \    |
	CodeRetainNotSupported                ReasonCode = 0x9A //        \    |
	CodeNotSupportedQoS                   ReasonCode = 0x9B //        \    |
	CodeUseAnotherServer                  ReasonCode = 0x9C //        \    |
	CodeServerMoved                       ReasonCode = 0x9D //        \    |
	CodeSharedSubscriptionNotSupported    ReasonCode = 0x9E //        \    |
	CodeConnectionRateExceeded            ReasonCode = 0x9F //        \    |
	CodeMaximumConnectTime                ReasonCode = 0xA0 //        \    |
	CodeSubscriptionIDNotSupported        ReasonCode = 0xA1 //        \    |
	CodeWildcardSubscriptionsNotSupported ReasonCode = 0xA2 //        \ <--|
)

nolint: golint // V3.1.1 \ V5.0

func (ReasonCode) Desc

func (c ReasonCode) Desc() string

Desc return code description

func (ReasonCode) Error

func (c ReasonCode) Error() string

Error returns the description of the ReturnCode

func (ReasonCode) IsValid

func (c ReasonCode) IsValid() bool

IsValid check either reason code is valid across all MQTT specs

func (ReasonCode) IsValidForType

func (c ReasonCode) IsValidForType(p Type) bool

IsValidForType check either reason code is valid for giver packet type

func (ReasonCode) IsValidV3

func (c ReasonCode) IsValidV3() bool

IsValidV3 check either reason code is valid for MQTT V3.1/V3.1.1 or not

func (ReasonCode) IsValidV5

func (c ReasonCode) IsValidV5() bool

IsValidV5 check either reason code is valid for MQTT V5.0 or not

func (ReasonCode) PacketTypeDir

func (c ReasonCode) PacketTypeDir(p Type) (CodeIssuer, error)

PacketTypeDir check direction of packet type

func (ReasonCode) Value

func (c ReasonCode) Value() byte

Value convert reason code to byte type

type SubAck

type SubAck struct {
	// contains filtered or unexported fields
}

SubAck A SUBACK Packet is sent by the Server to the Client to confirm receipt and processing of a SUBSCRIBE Packet.

A SUBACK Packet contains a list of return codes, that specify the maximum QoS level that was granted in each Subscription that was requested by the SUBSCRIBE.

func (*SubAck) AddReturnCode

func (msg *SubAck) AddReturnCode(ret ReasonCode) error

AddReturnCode adds a single QoS return value.

func (*SubAck) AddReturnCodes

func (msg *SubAck) AddReturnCodes(ret []ReasonCode) error

AddReturnCodes sets the list of QoS returns from the subscriptions sent in the SUBSCRIBE message. An error is returned if any of the QoS values are not valid.

func (*SubAck) Desc

func (h *SubAck) Desc() string

Desc returns a string description of the message type. For example, a CONNECT message would return "Client request to connect to Server." These descriptions are statically defined (copied from the MQTT spec) and cannot be changed.

func (*SubAck) Encode

func (h *SubAck) Encode(dst []byte) (int, error)

func (*SubAck) Flags

func (h *SubAck) Flags() byte

Flags returns the fixed header flags for this message.

func (*SubAck) ID

func (h *SubAck) ID() (IDType, error)

func (*SubAck) Name

func (h *SubAck) Name() string

Name returns a string representation of the message type. Examples include "PUBLISH", "SUBSCRIBE", and others. This is statically defined for each of the message types and cannot be changed.

func (*SubAck) PropertyForEach

func (h *SubAck) PropertyForEach(f func(PropertyID, interface{})) error

func (*SubAck) PropertyGet

func (h *SubAck) PropertyGet(id PropertyID) (interface{}, error)

func (*SubAck) PropertySet

func (h *SubAck) PropertySet(id PropertyID, val interface{}) error

func (*SubAck) RemainingLength

func (h *SubAck) RemainingLength() int32

RemainingLength returns the length of the non-fixed-header part of the message.

func (*SubAck) ReturnCodes

func (msg *SubAck) ReturnCodes() []ReasonCode

ReturnCodes returns the list of QoS returns from the subscriptions sent in the SUBSCRIBE message.

func (*SubAck) SetPacketID

func (msg *SubAck) SetPacketID(v IDType)

SetPacketID sets the ID of the packet.

func (*SubAck) SetVersion

func (h *SubAck) SetVersion(v ProtocolVersion)

func (*SubAck) Size

func (h *SubAck) Size() (int, error)

Size of message

func (*SubAck) Type

func (h *SubAck) Type() Type

Type returns the MessageType of the Message

func (*SubAck) Version

func (h *SubAck) Version() ProtocolVersion

type Subscribe

type Subscribe struct {
	// contains filtered or unexported fields
}

Subscribe The SUBSCRIBE Packet is sent from the Client to the Server to create one or more Subscriptions. Each Subscription registers a Client’s interest in one or more Topics. The Server sends PUBLISH Packets to the Client in order to forward Application Messages that were published to Topics that match these Subscriptions. The SUBSCRIBE Packet also specifies (for each Subscription) the maximum QoS with which the Server can send Application Messages to the Client.

func (*Subscribe) AddTopic

func (msg *Subscribe) AddTopic(topic string, ops SubscriptionOptions) error

AddTopic adds a single topic to the message, along with the corresponding QoS. An error is returned if QoS is invalid.

func (*Subscribe) Desc

func (h *Subscribe) Desc() string

Desc returns a string description of the message type. For example, a CONNECT message would return "Client request to connect to Server." These descriptions are statically defined (copied from the MQTT spec) and cannot be changed.

func (*Subscribe) Encode

func (h *Subscribe) Encode(dst []byte) (int, error)

func (*Subscribe) Flags

func (h *Subscribe) Flags() byte

Flags returns the fixed header flags for this message.

func (*Subscribe) ID

func (h *Subscribe) ID() (IDType, error)

func (*Subscribe) Name

func (h *Subscribe) Name() string

Name returns a string representation of the message type. Examples include "PUBLISH", "SUBSCRIBE", and others. This is statically defined for each of the message types and cannot be changed.

func (*Subscribe) PropertyForEach

func (h *Subscribe) PropertyForEach(f func(PropertyID, interface{})) error

func (*Subscribe) PropertyGet

func (h *Subscribe) PropertyGet(id PropertyID) (interface{}, error)

func (*Subscribe) PropertySet

func (h *Subscribe) PropertySet(id PropertyID, val interface{}) error

func (*Subscribe) RemainingLength

func (h *Subscribe) RemainingLength() int32

RemainingLength returns the length of the non-fixed-header part of the message.

func (*Subscribe) RemoveTopic

func (msg *Subscribe) RemoveTopic(topic string)

RemoveTopic removes a single topic from the list of existing ones in the message. If topic does not exist it just does nothing.

func (*Subscribe) SetPacketID

func (msg *Subscribe) SetPacketID(v IDType)

SetPacketID sets the ID of the packet.

func (*Subscribe) SetVersion

func (h *Subscribe) SetVersion(v ProtocolVersion)

func (*Subscribe) Size

func (h *Subscribe) Size() (int, error)

Size of message

func (*Subscribe) Topics

func (msg *Subscribe) Topics() omap.Map

Topics returns a list of topics sent by the Client.

func (*Subscribe) Type

func (h *Subscribe) Type() Type

Type returns the MessageType of the Message

func (*Subscribe) Version

func (h *Subscribe) Version() ProtocolVersion

type SubscriptionOptions

type SubscriptionOptions byte

SubscriptionOptions as per [MQTT-3.8.3.1]

func (SubscriptionOptions) NL

func (s SubscriptionOptions) NL() bool

NL No Local option

if true Application Messages MUST NOT be forwarded to a connection with a ClientID equal
to the ClientID of the publishing connection

V5.0 ONLY

func (SubscriptionOptions) QoS

func (s SubscriptionOptions) QoS() QosType

QoS quality of service

func (SubscriptionOptions) RAP

func (s SubscriptionOptions) RAP() bool

RAP Retain As Published option

true: Application Messages forwarded using this subscription keep the RETAIN flag they were published with
false : Application Messages forwarded using this subscription have the RETAIN flag set to 0.

Retained messages sent when the subscription is established have the RETAIN flag set to 1. V5.0 ONLY

func (SubscriptionOptions) RetainHandling

func (s SubscriptionOptions) RetainHandling() byte

RetainHandling specifies whether retained messages are sent when the subscription is established. This does not affect the sending of retained messages at any point after the subscribe. If there are no retained messages matching the Topic Filter, all of these values act the same. The values are:

0 = Send retained messages at the time of the subscribe
1 = Send retained messages at subscribe only if the subscription does not currently exist
2 = Do not send retained messages at the time of the subscribe

V5.0 ONLY

type TopicQos

type TopicQos map[string]SubscriptionOptions

TopicQos map containing topics as a keys with respective subscription options as value

type Type

type Type byte

Type is the type representing the MQTT packet types. In the MQTT spec, MQTT control packet type is represented as a 4-bit unsigned value.

const (
	// RESERVED is a reserved value and should be considered an invalid message type
	RESERVED Type = iota

	// CONNECT Client request to connect to Server
	// version: v3.1, v3.1.1, v5.0
	//      Dir: Client to Server
	CONNECT

	// CONNACK Connect acknowledgement
	// version: v3.1, v3.1.1, v5.0
	//      Dir: Server to Client
	CONNACK

	// PUBLISH Client to Server, or Server to Client. Publish message.
	PUBLISH

	// PUBACK Client to Server, or Server to Client. Publish acknowledgment for
	// QoS 1 messages.
	PUBACK

	// PUBREC Client to Server, or Server to Client. Publish received for QoS 2 messages.
	// Assured delivery part 1.
	PUBREC

	// PUBREL Client to Server, or Server to Client. Publish release for QoS 2 messages.
	// Assured delivery part 1.
	PUBREL

	// PUBCOMP Client to Server, or Server to Client. Publish complete for QoS 2 messages.
	// Assured delivery part 3.
	PUBCOMP

	// SUBSCRIBE Client to Server. Client subscribe request.
	SUBSCRIBE

	// SUBACK Server to Client. Subscribe acknowledgement.
	SUBACK

	// UNSUBSCRIBE Client to Server. Unsubscribe request.
	UNSUBSCRIBE

	// UNSUBACK Server to Client. Unsubscribe acknowlegment.
	UNSUBACK

	// PINGREQ Client to Server. PING request.
	PINGREQ

	// PINGRESP Server to Client. PING response.
	PINGRESP

	// DISCONNECT Client to Server. Client is disconnecting.
	DISCONNECT

	// AUTH is a reserved value and should be considered an invalid message type.
	AUTH
)

func (Type) DefaultFlags

func (t Type) DefaultFlags() byte

DefaultFlags returns the default flag values for the message type, as defined by the MQTT spec.

func (Type) Desc

func (t Type) Desc() string

Desc returns the description of the message type. It is statically defined (copied from MQTT spec) and cannot be changed.

func (Type) Name

func (t Type) Name() string

Name returns the name of the message type. It should correspond to one of the constant values defined for MessageType. It is statically defined and cannot be changed.

func (Type) Valid

func (t Type) Valid(v ProtocolVersion) (bool, error)

Valid returns a boolean indicating whether the message type is valid or not.

type UnSubAck

type UnSubAck struct {
	// contains filtered or unexported fields
}

UnSubAck The UNSUBACK Packet is sent by the Server to the Client to confirm receipt of an UNSUBSCRIBE Packet.

func (*UnSubAck) AddReturnCode

func (msg *UnSubAck) AddReturnCode(ret ReasonCode) error

AddReturnCode adds a single QoS return value.

func (*UnSubAck) AddReturnCodes

func (msg *UnSubAck) AddReturnCodes(ret []ReasonCode) error

AddReturnCodes sets the list of QoS returns from the subscriptions sent in the SUBSCRIBE message. An error is returned if any of the QoS values are not valid.

func (*UnSubAck) Desc

func (h *UnSubAck) Desc() string

Desc returns a string description of the message type. For example, a CONNECT message would return "Client request to connect to Server." These descriptions are statically defined (copied from the MQTT spec) and cannot be changed.

func (*UnSubAck) Encode

func (h *UnSubAck) Encode(dst []byte) (int, error)

func (*UnSubAck) Flags

func (h *UnSubAck) Flags() byte

Flags returns the fixed header flags for this message.

func (*UnSubAck) ID

func (h *UnSubAck) ID() (IDType, error)

func (*UnSubAck) Name

func (h *UnSubAck) Name() string

Name returns a string representation of the message type. Examples include "PUBLISH", "SUBSCRIBE", and others. This is statically defined for each of the message types and cannot be changed.

func (*UnSubAck) PropertyForEach

func (h *UnSubAck) PropertyForEach(f func(PropertyID, interface{})) error

func (*UnSubAck) PropertyGet

func (h *UnSubAck) PropertyGet(id PropertyID) (interface{}, error)

func (*UnSubAck) PropertySet

func (h *UnSubAck) PropertySet(id PropertyID, val interface{}) error

func (*UnSubAck) RemainingLength

func (h *UnSubAck) RemainingLength() int32

RemainingLength returns the length of the non-fixed-header part of the message.

func (*UnSubAck) ReturnCodes

func (msg *UnSubAck) ReturnCodes() []ReasonCode

ReturnCodes returns the list of QoS returns from the subscriptions sent in the SUBSCRIBE message.

func (*UnSubAck) SetPacketID

func (msg *UnSubAck) SetPacketID(v IDType)

SetPacketID sets the ID of the packet.

func (*UnSubAck) SetVersion

func (h *UnSubAck) SetVersion(v ProtocolVersion)

func (*UnSubAck) Size

func (h *UnSubAck) Size() (int, error)

Size of message

func (*UnSubAck) Type

func (h *UnSubAck) Type() Type

Type returns the MessageType of the Message

func (*UnSubAck) Version

func (h *UnSubAck) Version() ProtocolVersion

type UnSubscribe

type UnSubscribe struct {
	// contains filtered or unexported fields
}

UnSubscribe An UNSUBSCRIBE Packet is sent by the Client to the Server, to unsubscribe from topics.

func (*UnSubscribe) AddTopic

func (msg *UnSubscribe) AddTopic(topic string) error

AddTopic adds a single topic to the message.

func (*UnSubscribe) Desc

func (h *UnSubscribe) Desc() string

Desc returns a string description of the message type. For example, a CONNECT message would return "Client request to connect to Server." These descriptions are statically defined (copied from the MQTT spec) and cannot be changed.

func (*UnSubscribe) Encode

func (h *UnSubscribe) Encode(dst []byte) (int, error)

func (*UnSubscribe) Flags

func (h *UnSubscribe) Flags() byte

Flags returns the fixed header flags for this message.

func (*UnSubscribe) ID

func (h *UnSubscribe) ID() (IDType, error)

func (*UnSubscribe) Name

func (h *UnSubscribe) Name() string

Name returns a string representation of the message type. Examples include "PUBLISH", "SUBSCRIBE", and others. This is statically defined for each of the message types and cannot be changed.

func (*UnSubscribe) PropertyForEach

func (h *UnSubscribe) PropertyForEach(f func(PropertyID, interface{})) error

func (*UnSubscribe) PropertyGet

func (h *UnSubscribe) PropertyGet(id PropertyID) (interface{}, error)

func (*UnSubscribe) PropertySet

func (h *UnSubscribe) PropertySet(id PropertyID, val interface{}) error

func (*UnSubscribe) RemainingLength

func (h *UnSubscribe) RemainingLength() int32

RemainingLength returns the length of the non-fixed-header part of the message.

func (*UnSubscribe) RemoveTopic

func (msg *UnSubscribe) RemoveTopic(topic string)

RemoveTopic removes a single topic from the list of existing ones in the message. If topic does not exist it just does nothing.

func (*UnSubscribe) SetPacketID

func (msg *UnSubscribe) SetPacketID(v IDType)

SetPacketID sets the ID of the packet.

func (*UnSubscribe) SetVersion

func (h *UnSubscribe) SetVersion(v ProtocolVersion)

func (*UnSubscribe) Size

func (h *UnSubscribe) Size() (int, error)

Size of message

func (*UnSubscribe) Topics

func (msg *UnSubscribe) Topics() omap.Map

Topics returns a list of topics sent by the Client.

func (*UnSubscribe) Type

func (h *UnSubscribe) Type() Type

Type returns the MessageType of the Message

func (*UnSubscribe) Version

func (h *UnSubscribe) Version() ProtocolVersion

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL