Documentation
¶
Index ¶
Constants ¶
View Source
const ( // MessageTypeRequest is the message type for requests. MessageTypeRequest = byte(0x01) // MessageTypeResponse is the message type for responses. MessageTypeResponse = byte(0x02) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct {
Remote *nacl.PublicKey
ProbeId uint32
SentAt time.Time
// contains filtered or unexported fields
}
Message represents a QOS message, which may be a request or response.
func NewRequest ¶
func NewRequest(priv *nacl.PrivateKey, remote *nacl.PublicKey) *Message
NewRequest builds a new QOS request for the given remote peer key.
func NewResponse ¶
NewResponse builds a new QOS response for the given request.
func ParseQOSMessage ¶
ParseQOSMessage takes in bytes for a packet received over the network, it returns the parsed message, true if the bytes indeed corresponded to a message, and an error if and only if the packet was for a QOS message but it failed to be parsed.
func (*Message) MessageType ¶
MessageType returns the type of the message.
Click to show internal directories.
Click to hide internal directories.