moq: link primitives to draft-17 sections (#6044)

This commit is contained in:
Alessandro Ros
2026-08-05 09:33:39 +00:00
committed by GitHub
parent c48b0b8fee
commit f0d2f11525
14 changed files with 52 additions and 20 deletions
@@ -12,7 +12,9 @@ import (
const typePublish varint.Varint = 0x1d
// Publish is the PUBLISH control message.
// spec: draft-18/19, section 10.10
// spec:
// * draft-17, section 9.11
// * draft-18/19, section 10.10
type Publish struct {
RequestID uint64
Namespace namespace.Namespace
@@ -9,8 +9,9 @@ import (
const typePublishOk varint.Varint = 0x1E
// PublishOk is the PUBLISH_OK control message.
// spec: draft-17, section 9.12
// spec: draft-18/19, section 10.5 (alias of REQUEST_OK)
// spec:
// * draft-17, section 9.12
// * draft-18/19, section 10.5 (alias of REQUEST_OK)
type PublishOk struct {
Parameters parameter.Parameters
TrackProperties property.Properties
@@ -11,7 +11,10 @@ const typeRequestError varint.Varint = 0x05
// RequestErrorCode is a code of REQUEST_ERROR.
type RequestErrorCode uint64
// spec: draft-18, section 15.10.2 / draft-19, section 15.11.2
// spec:
// * draft-17, section 14.5.2
// * draft-18, section 15.10.2
// * draft-19, section 15.11.2
const (
RequestErrorCodeUnauthorized RequestErrorCode = 0x01
RequestErrorCodeNotSupported RequestErrorCode = 0x03
@@ -20,7 +23,9 @@ const (
)
// RequestError is the REQUEST_ERROR control message.
// spec: draft-18/19, section 10.6.2
// spec:
// * draft-17, section 9.7
// * draft-18/19, section 10.6.2
type RequestError struct {
Code RequestErrorCode
Reason string
@@ -9,7 +9,9 @@ import (
const typeRequestOk varint.Varint = 0x07
// RequestOk is the REQUEST_OK control message.
// spec: draft-18/19, section 10.5
// spec:
// * draft-17, section 9.6
// * draft-18/19, section 10.5
type RequestOk struct {
Parameters parameter.Parameters
TrackProperties property.Properties
@@ -14,7 +14,9 @@ const (
)
// Setup is the SETUP control message.
// spec: draft-18/19, section 10.3
// spec:
// * draft-17, section 9.4
// * draft-18/19, section 10.3
type Setup struct {
Path string
Authority string
@@ -11,7 +11,9 @@ import (
const typeSubscribe varint.Varint = 0x03
// Subscribe is the SUBSCRIBE control message.
// spec: draft-18/19, section 10.7
// spec:
// * draft-17, section 9.8
// * draft-18/19, section 10.7
type Subscribe struct {
RequestID uint64
Namespace namespace.Namespace
@@ -9,7 +9,9 @@ import (
const typeSubscribeOk varint.Varint = 0x04
// SubscribeOk is the SUBSCRIBE_OK control message.
// spec: draft-18/19, section 10.8
// spec:
// * draft-17, section 9.9
// * draft-18/19, section 10.8
type SubscribeOk struct {
TrackAlias uint64
Parameters parameter.Parameters
@@ -8,12 +8,12 @@ import (
)
const (
// spec: draft-18/19, section 2.4.1
// spec: draft-17/18/19, section 2.4.1
maxFieldCount = 32
)
// Namespace is a MOQ track namespace.
// spec: draft-18/19, section 2.4.1
// spec: draft-17/18/19, section 2.4.1
type Namespace []string
// Unmarshal deserializes a namespace from a buffer.
@@ -9,16 +9,22 @@ import (
const typeAuthorizationToken = 0x03
// AuthorizationTokenAliasType is a value of Alias Type.
// spec: draft-18/19, section 10.2.2
// spec:
// * draft-17, section 9.3.2
// * draft-18/19, section 10.2.2
type AuthorizationTokenAliasType uint64
// spec: draft-18/19, section 10.2.2
// spec:
// * draft-17, section 9.3.2
// * draft-18/19, section 10.2.2
const (
AuthorizationTokenAliasTypeUseValue AuthorizationTokenAliasType = 0x03
)
// AuthorizationToken is the AUTHORIZATION_TOKEN parameter.
// spec: draft-18/19, section 10.2.2
// spec:
// * draft-17, section 9.3.2
// * draft-18/19, section 10.2.2
type AuthorizationToken struct {
AliasType AuthorizationTokenAliasType
TokenType uint64
@@ -8,7 +8,9 @@ import (
)
// Parameter is a parameter of a control message.
// spec: draft-18/19, section 10.2
// spec:
// * draft-17, section 9.3
// * draft-18/19, section 10.2
type Parameter interface {
isParameter()
paramType() uint64
+6 -2
View File
@@ -8,7 +8,9 @@ import (
)
// Property is an object property.
// spec: draft-18/19, section 11.2.1.2
// spec:
// * draft-17, section 10.2.1.2
// * draft-18/19, section 11.2.1.2
type Property interface {
isProperty()
propType() varint.Varint
@@ -18,7 +20,9 @@ type Property interface {
}
// Properties are object properties.
// spec: draft-18/19, section 11.2.1.2
// spec:
// * draft-17, section 10.2.1.2
// * draft-18/19, section 11.2.1.2
type Properties []Property
// Unmarshal decodes properties.
+3 -1
View File
@@ -8,7 +8,9 @@ import (
)
// Header is the SUBGROUP_HEADER structure.
// spec: draft-18/19, section 11.4.2
// spec:
// * draft-17, section 10.4.2
// * draft-18/19, section 11.4.2
type Header struct {
Properties bool
FirstObject bool
+3 -1
View File
@@ -14,7 +14,9 @@ const (
)
// Object is an object of a subgroup stream.
// spec: draft-18/19, section 11.4.2
// spec:
// * draft-17, section 10.4.2
// * draft-18/19, section 11.4.2
type Object struct {
IDDelta uint64
Properties property.Properties
+1 -1
View File
@@ -7,7 +7,7 @@ import (
)
// Varint is a variable-length integer.
// spec: draft-18/19, section 1.4.1
// spec: draft-17/18/19, section 1.4.1
type Varint uint64
// Read reads a Varint from a Reader.