wire

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FetchTypeStandalone      = 0x01
	FetchTypeRelativeJoining = 0x02
	FetchTypeAbsoluteJoining = 0x03
)
View Source
const (
	PathParameterKey                  = 0x01
	MaxRequestIDParameterKey          = 0x02
	MaxAuthTokenCacheSizeParameterKey = 0x03
)
View Source
const (
	AuthorizationTokenParameterKey = 0x01
	DeliveryTimeoutParameterKey    = 0x02
	MaxCacheDurationParameterKey   = 0x03
)
View Source
const (
	TokenTypeDelete   = 0x00
	TokenTypeRegister = 0x01
	TokenTypeUseAlias = 0x02
	TokenTypeUseValue = 0x03
)

Variables

View Source
var SupportedVersions = []Version{CurrentVersion}

Functions

This section is empty.

Types

type AnnounceCancelMessage

type AnnounceCancelMessage struct {
	TrackNamespace Tuple
	ErrorCode      uint64
	ReasonPhrase   string
}

func (*AnnounceCancelMessage) Append

func (m *AnnounceCancelMessage) Append(buf []byte) []byte

func (AnnounceCancelMessage) GetTrackNamespace

func (m AnnounceCancelMessage) GetTrackNamespace() string

func (*AnnounceCancelMessage) LogValue

func (m *AnnounceCancelMessage) LogValue() slog.Value

func (AnnounceCancelMessage) Type

func (m AnnounceCancelMessage) Type() controlMessageType

type AnnounceErrorMessage

type AnnounceErrorMessage struct {
	RequestID    uint64
	ErrorCode    uint64
	ReasonPhrase string
}

func (*AnnounceErrorMessage) Append

func (m *AnnounceErrorMessage) Append(buf []byte) []byte

func (*AnnounceErrorMessage) LogValue

func (m *AnnounceErrorMessage) LogValue() slog.Value

func (AnnounceErrorMessage) Type

func (m AnnounceErrorMessage) Type() controlMessageType

type AnnounceMessage

type AnnounceMessage struct {
	RequestID      uint64
	TrackNamespace Tuple
	Parameters     KVPList
}

func (*AnnounceMessage) Append

func (m *AnnounceMessage) Append(buf []byte) []byte

func (AnnounceMessage) GetTrackNamespace

func (m AnnounceMessage) GetTrackNamespace() string

func (*AnnounceMessage) LogValue

func (m *AnnounceMessage) LogValue() slog.Value

func (AnnounceMessage) Type

func (m AnnounceMessage) Type() controlMessageType

type AnnounceOkMessage

type AnnounceOkMessage struct {
	RequestID uint64
}

func (*AnnounceOkMessage) Append

func (m *AnnounceOkMessage) Append(buf []byte) []byte

func (*AnnounceOkMessage) LogValue

func (m *AnnounceOkMessage) LogValue() slog.Value

func (AnnounceOkMessage) Type

func (m AnnounceOkMessage) Type() controlMessageType

type ClientSetupMessage

type ClientSetupMessage struct {
	SupportedVersions versions
	SetupParameters   KVPList
}

func (*ClientSetupMessage) Append

func (m *ClientSetupMessage) Append(buf []byte) []byte

func (*ClientSetupMessage) LogValue

func (m *ClientSetupMessage) LogValue() slog.Value

func (ClientSetupMessage) Type

func (m ClientSetupMessage) Type() controlMessageType

type ControlMessage

type ControlMessage interface {
	Message
	Type() controlMessageType
	slog.LogValuer
}

type ControlMessageParser

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

func NewControlMessageParser

func NewControlMessageParser(r io.Reader) *ControlMessageParser

func (*ControlMessageParser) Parse

type FetchCancelMessage

type FetchCancelMessage struct {
	RequestID uint64
}

TODO: Add tests

func (*FetchCancelMessage) Append

func (m *FetchCancelMessage) Append(buf []byte) []byte

func (*FetchCancelMessage) LogValue

func (m *FetchCancelMessage) LogValue() slog.Value

func (FetchCancelMessage) Type

func (m FetchCancelMessage) Type() controlMessageType

type FetchErrorMessage

type FetchErrorMessage struct {
	RequestID    uint64
	ErrorCode    uint64
	ReasonPhrase string
}

TODO: Add tests

func (*FetchErrorMessage) Append

func (m *FetchErrorMessage) Append(buf []byte) []byte

func (*FetchErrorMessage) LogValue

func (m *FetchErrorMessage) LogValue() slog.Value

func (FetchErrorMessage) Type

func (m FetchErrorMessage) Type() controlMessageType

type FetchHeaderMessage

type FetchHeaderMessage struct {
	RequestID uint64
}

func (*FetchHeaderMessage) Append

func (m *FetchHeaderMessage) Append(buf []byte) []byte

type FetchMessage

type FetchMessage struct {
	RequestID          uint64
	SubscriberPriority uint8
	GroupOrder         uint8
	FetchType          uint64
	TrackNamespace     Tuple
	TrackName          []byte
	StartGroup         uint64
	StartObject        uint64
	EndGroup           uint64
	EndObject          uint64
	JoiningSubscribeID uint64
	JoiningStart       uint64
	Parameters         KVPList
}

TODO: Add tests

func (*FetchMessage) Append

func (m *FetchMessage) Append(buf []byte) []byte

func (*FetchMessage) LogValue

func (m *FetchMessage) LogValue() slog.Value

Attrs implements moqt.ControlMessage.

func (FetchMessage) Type

func (m FetchMessage) Type() controlMessageType

type FetchOkMessage

type FetchOkMessage struct {
	RequestID           uint64
	GroupOrder          uint8
	EndOfTrack          uint8
	EndLocation         Location
	SubscribeParameters KVPList
}

TODO: Add tests

func (*FetchOkMessage) Append

func (m *FetchOkMessage) Append(buf []byte) []byte

func (*FetchOkMessage) LogValue

func (m *FetchOkMessage) LogValue() slog.Value

func (FetchOkMessage) Type

func (m FetchOkMessage) Type() controlMessageType

type FilterType

type FilterType uint64
const (
	FilterTypeLatestObject   FilterType = 0x02
	FilterTypeNextGroupStart FilterType = 0x01
	FilterTypeAbsoluteStart  FilterType = 0x03
	FilterTypeAbsoluteRange  FilterType = 0x04
)

func (FilterType) String

func (f FilterType) String() string

String returns a human-readable description of the FilterType.

type GoAwayMessage

type GoAwayMessage struct {
	NewSessionURI string
}

func (*GoAwayMessage) Append

func (m *GoAwayMessage) Append(buf []byte) []byte

func (*GoAwayMessage) LogValue

func (m *GoAwayMessage) LogValue() slog.Value

func (GoAwayMessage) Type

func (m GoAwayMessage) Type() controlMessageType

type GroupOrder

type GroupOrder uint8
const (
	// GroupOrderNone indicates no specific ordering preference.
	GroupOrderNone GroupOrder = 0x0

	// GroupOrderAscending indicates groups should be delivered in ascending order.
	GroupOrderAscending GroupOrder = 0x1

	// GroupOrderDescending indicates groups should be delivered in descending order.
	GroupOrderDescending GroupOrder = 0x2
)

func (GroupOrder) String

func (g GroupOrder) String() string

String returns a human-readable description of the GroupOrder.

type KVPList

type KVPList []KeyValuePair

func (KVPList) String

func (pp KVPList) String() string

type KeyValuePair

type KeyValuePair struct {
	Type        uint64
	ValueBytes  []byte
	ValueVarInt uint64
}

func (*KeyValuePair) String

func (p *KeyValuePair) String() string

type Location

type Location struct {
	Group  uint64
	Object uint64
}

type MaxRequestIDMessage

type MaxRequestIDMessage struct {
	RequestID uint64
}

TODO: Add tests

func (*MaxRequestIDMessage) Append

func (m *MaxRequestIDMessage) Append(buf []byte) []byte

func (*MaxRequestIDMessage) LogValue

func (m *MaxRequestIDMessage) LogValue() slog.Value

func (MaxRequestIDMessage) Type

func (m MaxRequestIDMessage) Type() controlMessageType

type Message

type Message interface {
	Append([]byte) []byte
	// contains filtered or unexported methods
}

type ObjectDatagramMessage

type ObjectDatagramMessage struct {
	TrackAlias             uint64
	GroupID                uint64
	ObjectID               uint64
	PublisherPriority      uint8
	ObjectExtensionHeaders KVPList
	ObjectPayload          []byte
	ObjectStatus           ObjectStatus
}

func (*ObjectDatagramMessage) AppendDatagram

func (m *ObjectDatagramMessage) AppendDatagram(buf []byte) []byte

func (*ObjectDatagramMessage) AppendDatagramStatus

func (m *ObjectDatagramMessage) AppendDatagramStatus(buf []byte) []byte

func (*ObjectDatagramMessage) Parse

func (m *ObjectDatagramMessage) Parse(data []byte) (parsed int, err error)

type ObjectMessage

type ObjectMessage struct {
	TrackAlias             uint64
	GroupID                uint64
	SubgroupID             uint64
	ObjectID               uint64
	PublisherPriority      uint8
	ObjectExtensionHeaders KVPList
	ObjectStatus           ObjectStatus
	ObjectPayload          []byte
}

func (*ObjectMessage) AppendFetch

func (m *ObjectMessage) AppendFetch(buf []byte) []byte

func (*ObjectMessage) AppendSubgroup

func (m *ObjectMessage) AppendSubgroup(buf []byte) []byte

type ObjectStatus

type ObjectStatus int
const (
	ObjectStatusNormal             ObjectStatus = 0x00
	ObjectStatusObjectDoesNotExist ObjectStatus = 0x01
	ObjectStatusEndOfGroup         ObjectStatus = 0x03
	ObjectStatusEndOfTrack         ObjectStatus = 0x04
)

type ObjectStreamParser

type ObjectStreamParser struct {
	PublisherPriority uint8
	GroupID           uint64
	SubgroupID        uint64
	// contains filtered or unexported fields
}

func NewObjectStreamParser

func NewObjectStreamParser(r io.Reader, streamID uint64, qlogger *qlog.Logger) (*ObjectStreamParser, error)

func (*ObjectStreamParser) Identifier

func (p *ObjectStreamParser) Identifier() uint64

func (*ObjectStreamParser) Messages

func (p *ObjectStreamParser) Messages() iter.Seq2[*ObjectMessage, error]

func (*ObjectStreamParser) Parse

func (p *ObjectStreamParser) Parse() (*ObjectMessage, error)

func (*ObjectStreamParser) Type

func (p *ObjectStreamParser) Type() StreamType

type RequestsBlockedMessage

type RequestsBlockedMessage struct {
	MaximumRequestID uint64
}

func (*RequestsBlockedMessage) Append

func (m *RequestsBlockedMessage) Append(buf []byte) []byte

func (*RequestsBlockedMessage) LogValue

func (m *RequestsBlockedMessage) LogValue() slog.Value

func (RequestsBlockedMessage) Type

func (m RequestsBlockedMessage) Type() controlMessageType

type ServerSetupMessage

type ServerSetupMessage struct {
	SelectedVersion Version
	SetupParameters KVPList
}

func (*ServerSetupMessage) Append

func (m *ServerSetupMessage) Append(buf []byte) []byte

func (*ServerSetupMessage) LogValue

func (m *ServerSetupMessage) LogValue() slog.Value

func (ServerSetupMessage) Type

func (m ServerSetupMessage) Type() controlMessageType

type StreamType

type StreamType uint64
const (
	StreamTypeFetch                StreamType = 0x05
	StreamTypeSubgroupZeroSIDNoExt StreamType = 0x08
	StreamTypeSubgroupZeroSIDExt   StreamType = 0x09
	StreamTypeSubgroupNoSIDNoExt   StreamType = 0x0a
	StreamTypeSubgroupNoSIDExt     StreamType = 0x0b
	StreamTypeSubgroupSIDNoExt     StreamType = 0x0c
	StreamTypeSubgroupSIDExt       StreamType = 0x0d
)

type SubgroupHeaderMessage

type SubgroupHeaderMessage struct {
	TrackAlias        uint64
	GroupID           uint64
	SubgroupID        uint64
	PublisherPriority uint8
}

func (*SubgroupHeaderMessage) Append

func (m *SubgroupHeaderMessage) Append(buf []byte) []byte

type SubscribeAnnouncesErrorMessage

type SubscribeAnnouncesErrorMessage struct {
	RequestID    uint64
	ErrorCode    uint64
	ReasonPhrase string
}

TODO: Add tests

func (*SubscribeAnnouncesErrorMessage) Append

func (m *SubscribeAnnouncesErrorMessage) Append(buf []byte) []byte

func (*SubscribeAnnouncesErrorMessage) LogValue

func (SubscribeAnnouncesErrorMessage) Type

func (m SubscribeAnnouncesErrorMessage) Type() controlMessageType

type SubscribeAnnouncesMessage

type SubscribeAnnouncesMessage struct {
	RequestID            uint64
	TrackNamespacePrefix Tuple
	Parameters           KVPList
}

TODO: Add tests

func (*SubscribeAnnouncesMessage) Append

func (m *SubscribeAnnouncesMessage) Append(buf []byte) []byte

func (*SubscribeAnnouncesMessage) LogValue

func (m *SubscribeAnnouncesMessage) LogValue() slog.Value

func (SubscribeAnnouncesMessage) Type

func (m SubscribeAnnouncesMessage) Type() controlMessageType

type SubscribeAnnouncesOkMessage

type SubscribeAnnouncesOkMessage struct {
	RequestID uint64
}

TODO: Add tests

func (*SubscribeAnnouncesOkMessage) Append

func (m *SubscribeAnnouncesOkMessage) Append(buf []byte) []byte

func (*SubscribeAnnouncesOkMessage) LogValue

func (m *SubscribeAnnouncesOkMessage) LogValue() slog.Value

func (SubscribeAnnouncesOkMessage) Type

func (m SubscribeAnnouncesOkMessage) Type() controlMessageType

type SubscribeDoneMessage

type SubscribeDoneMessage struct {
	RequestID    uint64
	StatusCode   uint64
	StreamCount  uint64
	ReasonPhrase string
}

func (*SubscribeDoneMessage) Append

func (m *SubscribeDoneMessage) Append(buf []byte) []byte

func (*SubscribeDoneMessage) LogValue

func (m *SubscribeDoneMessage) LogValue() slog.Value

func (SubscribeDoneMessage) Type

func (m SubscribeDoneMessage) Type() controlMessageType

type SubscribeErrorMessage

type SubscribeErrorMessage struct {
	RequestID    uint64
	ErrorCode    uint64
	ReasonPhrase string
	TrackAlias   uint64
}

func (*SubscribeErrorMessage) Append

func (m *SubscribeErrorMessage) Append(buf []byte) []byte

func (*SubscribeErrorMessage) LogValue

func (m *SubscribeErrorMessage) LogValue() slog.Value

func (SubscribeErrorMessage) Type

func (m SubscribeErrorMessage) Type() controlMessageType

type SubscribeMessage

type SubscribeMessage struct {
	RequestID          uint64
	TrackAlias         uint64
	TrackNamespace     Tuple
	TrackName          []byte
	SubscriberPriority uint8
	GroupOrder         GroupOrder
	Forward            uint8
	FilterType         FilterType
	StartLocation      Location
	EndGroup           uint64
	Parameters         KVPList
}

func (*SubscribeMessage) Append

func (m *SubscribeMessage) Append(buf []byte) []byte

func (*SubscribeMessage) LogValue

func (m *SubscribeMessage) LogValue() slog.Value

func (SubscribeMessage) Type

func (m SubscribeMessage) Type() controlMessageType

type SubscribeOkMessage

type SubscribeOkMessage struct {
	RequestID       uint64
	Expires         time.Duration
	GroupOrder      uint8
	ContentExists   bool
	LargestLocation Location
	Parameters      KVPList
}

func (*SubscribeOkMessage) Append

func (m *SubscribeOkMessage) Append(buf []byte) []byte

func (*SubscribeOkMessage) LogValue

func (m *SubscribeOkMessage) LogValue() slog.Value

func (SubscribeOkMessage) Type

func (m SubscribeOkMessage) Type() controlMessageType

type SubscribeUpdateMessage

type SubscribeUpdateMessage struct {
	RequestID          uint64
	StartLocation      Location
	EndGroup           uint64
	SubscriberPriority uint8
	Forward            uint8
	Parameters         KVPList
}

func (*SubscribeUpdateMessage) Append

func (m *SubscribeUpdateMessage) Append(buf []byte) []byte

func (*SubscribeUpdateMessage) LogValue

func (m *SubscribeUpdateMessage) LogValue() slog.Value

func (SubscribeUpdateMessage) Type

func (m SubscribeUpdateMessage) Type() controlMessageType

type Token

type Token struct {
	AliasType uint64
	Alias     uint64
	Type      uint64
	Value     []byte
}

func (Token) Append

func (t Token) Append(buf []byte) []byte

func (*Token) Parse

func (t *Token) Parse(data []byte) (parsed int, err error)

type TrackStatusMessage

type TrackStatusMessage struct {
	RequestID       uint64
	StatusCode      uint64
	LargestLocation Location
	Parameters      KVPList
}

func (*TrackStatusMessage) Append

func (m *TrackStatusMessage) Append(buf []byte) []byte

func (*TrackStatusMessage) LogValue

func (m *TrackStatusMessage) LogValue() slog.Value

func (TrackStatusMessage) Type

func (m TrackStatusMessage) Type() controlMessageType

type TrackStatusRequestMessage

type TrackStatusRequestMessage struct {
	RequestID      uint64
	TrackNamespace Tuple
	TrackName      []byte
	Parameters     KVPList
}

func (*TrackStatusRequestMessage) Append

func (m *TrackStatusRequestMessage) Append(buf []byte) []byte

func (*TrackStatusRequestMessage) LogValue

func (m *TrackStatusRequestMessage) LogValue() slog.Value

func (TrackStatusRequestMessage) Type

func (m TrackStatusRequestMessage) Type() controlMessageType

type Tuple

type Tuple []string

func (Tuple) MarshalJSON

func (t Tuple) MarshalJSON() ([]byte, error)

func (Tuple) String

func (t Tuple) String() string

type UnannounceMessage

type UnannounceMessage struct {
	TrackNamespace Tuple
}

func (*UnannounceMessage) Append

func (m *UnannounceMessage) Append(buf []byte) []byte

func (*UnannounceMessage) LogValue

func (m *UnannounceMessage) LogValue() slog.Value

func (UnannounceMessage) Type

func (m UnannounceMessage) Type() controlMessageType

type UnsubscribeAnnouncesMessage

type UnsubscribeAnnouncesMessage struct {
	TrackNamespacePrefix Tuple
}

TODO: Add tests

func (*UnsubscribeAnnouncesMessage) Append

func (m *UnsubscribeAnnouncesMessage) Append(buf []byte) []byte

func (*UnsubscribeAnnouncesMessage) LogValue

func (m *UnsubscribeAnnouncesMessage) LogValue() slog.Value

func (UnsubscribeAnnouncesMessage) Type

func (m UnsubscribeAnnouncesMessage) Type() controlMessageType

type UnsubscribeMessage

type UnsubscribeMessage struct {
	RequestID uint64
}

func (*UnsubscribeMessage) Append

func (m *UnsubscribeMessage) Append(buf []byte) []byte

func (*UnsubscribeMessage) LogValue

func (m *UnsubscribeMessage) LogValue() slog.Value

func (UnsubscribeMessage) Type

func (m UnsubscribeMessage) Type() controlMessageType

type Version

type Version uint64
const (
	Draft_ietf_moq_transport_00 Version = 0xff000000
	Draft_ietf_moq_transport_01 Version = 0xff000001
	Draft_ietf_moq_transport_02 Version = 0xff000002
	Draft_ietf_moq_transport_03 Version = 0xff000003
	Draft_ietf_moq_transport_04 Version = 0xff000004
	Draft_ietf_moq_transport_05 Version = 0xff000005
	Draft_ietf_moq_transport_06 Version = 0xff000006
	Draft_ietf_moq_transport_07 Version = 0xff000007
	Draft_ietf_moq_transport_08 Version = 0xff000008
	Draft_ietf_moq_transport_10 Version = 0xff00000a
	Draft_ietf_moq_transport_11 Version = 0xff00000b

	CurrentVersion = Draft_ietf_moq_transport_11
)

func (Version) Len

func (v Version) Len() uint64

func (Version) String

func (v Version) String() string

Jump to

Keyboard shortcuts

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