Documentation ¶
Index ¶
Constants ¶
View Source
const ( // MessageTypeHeader is the unique id of a tlv header. MessageTypeHeader message.Type = 0 // HeaderTypeBytesLength defines the amount of bytes dedicated for the message type in the packet header. HeaderTypeBytesLength = 1 // HeaderLengthByteLength defines the amount of bytes dedicated for the message length denotation in the packet header. HeaderLengthByteLength = 2 // HeaderBytesLength defines the amount of bytes making up the protocol TLV packet header. HeaderBytesLength = HeaderLengthByteLength + HeaderTypeBytesLength )
Variables ¶
View Source
var ( // ErrInvalidMessageLength is returned when a packet advertises a message length which // is invalid for the given message type. ErrInvalidMessageLength = errors.New("invalid message length") )
View Source
var ( // HeaderMessageDefinition is the message header sent in each message denoting the TLV fields. HeaderMessageDefinition = &message.Definition{ ID: MessageTypeHeader, MaxBytesLength: HeaderBytesLength, VariableLength: false, } )
Functions ¶
Types ¶
type Header ¶
type Header struct { // The definition of the message. Definition *message.Definition // The length in bytes of the message. MessageBytesLength uint16 }
Header includes the definition of the message and its bytes length.
Click to show internal directories.
Click to hide internal directories.