qos

package
v1.4.113 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

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

func NewResponse(req *Message) *Message

NewResponse builds a new QOS response for the given request.

func ParseQOSMessage

func ParseQOSMessage(key *nacl.PrivateKey, pck []byte) (*Message, bool, error)

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) Encode

func (m *Message) Encode() []byte

Encode encodes a Message onto wire-ready bytes.

func (*Message) MessageType

func (m *Message) MessageType() byte

MessageType returns the type of the message.

Jump to

Keyboard shortcuts

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