protocol

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package protocol is the Go owner of the Piik wire contract. Its shared fixtures and scalar helpers are kept semantics-compatible with the Browser implementation. The package performs no I/O and imports nothing from other internal packages.

Index

Constants

View Source
const (
	MaxViewersPerRoomLimit      = 20
	MaxParticipantsPerRoomLimit = MaxViewersPerRoomLimit + 1
	MaxSignalBytes              = 64 * 1024
	SignalingProtocol           = "piik-v23"
	RoomCodeLength              = 4
	MaxMediaRouteRevision       = MaxSafeInteger
	MaxIceServerURLs            = 8

	MaxNatPredictionAuxiliaryStunURLs = 2

	MaxViewerQualityEvidenceBytes       = 2 * 1024
	ViewerQualityEvidenceIntervalMs     = 2_000
	ViewerQualityEvidenceExpiryMs       = 5_000
	PersistentNativeEdgeDegradedWindows = 3

	MaxDisplayNameCodePoints     = 24
	DefaultViewerDisplayName     = "观众"
	DefaultHostDisplayNamePrefix = "房主"

	MinViewerPasswordLength = 1
	MaxViewerPasswordLength = 64

	// MaxStunURLLength is stunUrlSchema's .max(512), in UTF-16 code units.
	MaxStunURLLength = 512
)

Limits and identifiers in the Piik wire contract.

View Source
const (
	DefaultEndpointMediaCopyCapacity = 2
	MaxEndpointMediaCopyCapacity     = 3
)

Endpoint media copy accounting bounds, from src/shared/media-copy-accounting.ts.

View Source
const InteractionIntervalMs = 800
View Source
const MaxChatCodePoints = 280
View Source
const MaxSafeInteger = 9007199254740991

MaxSafeInteger is JavaScript's Number.MAX_SAFE_INTEGER.

Variables

View Source
var DefaultQualitySettings = QualitySettings{
	Resolution:            "1080p",
	MaxFramerate:          30,
	MaxBitrate:            5_000_000,
	DegradationPreference: "balanced",
	ScreenAudioQuality:    "music",
}

DefaultQualitySettings mirrors DEFAULT_QUALITY_SETTINGS.

View Source
var DefaultRoutePolicy = RoutePolicy{
	PeerOnly:             false,
	TopologyOptimization: true,
	NatPrediction:        false,
}

DefaultRoutePolicy mirrors DEFAULT_ROUTE_POLICY.

View Source
var ErrEndpointMediaCopyCapacity = errors.New(
	"Endpoint media copy capacity must be 1, 2, or 3")

ErrEndpointMediaCopyCapacity is the assertEndpointMediaCopyCapacity throw.

View Source
var NatTraversalPaths = [...]string{"unknown", "ordinary", "predicted"}

NatTraversalPaths mirrors NAT_TRAVERSAL_PATHS in src/shared/nat-candidate.ts.

Functions

func AssertEndpointMediaCopyCapacity

func AssertEndpointMediaCopyCapacity(capacity int) error

func EncodeServerMessage

func EncodeServerMessage(message ServerMessage) ([]byte, error)

EncodeServerMessage serializes one server message with the key order of the TypeScript object literal that produces it.

func EndpointMediaCopyCountFits

func EndpointMediaCopyCountFits(count, capacity int, phase EndpointMediaCopyPhase) bool

func EndpointMediaCopyLimit

func EndpointMediaCopyLimit(capacity int, phase EndpointMediaCopyPhase) int

EndpointMediaCopyLimit panics on an invalid capacity, where TypeScript throws.

func IsCanonicalVideoCodecEvidence

func IsCanonicalVideoCodecEvidence(codec, codecProfile, codecParameters string) bool

IsCanonicalVideoCodecEvidence uses empty strings for TypeScript nulls; the schema rejects an empty codec string before this refinement runs.

func IsEndpointMediaCopyCapacity

func IsEndpointMediaCopyCapacity(capacity int) bool

Go's int makes the fractional-value part of Number.isSafeInteger implicit.

func IsJSWhitespace

func IsJSWhitespace(character rune) bool

IsJSWhitespace matches the JavaScript regular-expression \s class, which is also what String.prototype.trim and Number(string) strip. It is the single owner of that predicate for the server packages.

func NormalizeDisplayName

func NormalizeDisplayName(value string) (string, bool)

NormalizeDisplayName returns false where the shared TypeScript normalizer returns null.

func PacketLossPercentFromDeltas

func PacketLossPercentFromDeltas(packetsReceivedDelta, packetsLostDelta *float64) (float64, bool)

PacketLossPercentFromDeltas maps nil arguments to TypeScript null; ok is false where the shared calculation returns null.

func UTF16Length

func UTF16Length(value string) int

UTF16Length counts UTF-16 code units, which is what zod's string .min/.max/ .length and String.prototype.length measure: not bytes, not code points. It is the single owner of that measurement for the server packages.

func ValidDisplayName

func ValidDisplayName(value string) bool

ValidDisplayName mirrors displayNameSchema's bounds and canonical refine.

func ValidOpaqueID

func ValidOpaqueID(value string) bool

ValidOpaqueID mirrors opaqueIdSchema: 8..128 code units of [A-Za-z0-9_-].

func ValidRoomCode

func ValidRoomCode(value string) bool

ValidRoomCode mirrors roomCodeSchema.

func ValidStunURL

func ValidStunURL(value string) bool

ValidStunURL ports isValidStunUrl from src/shared/protocol.ts. The TypeScript feeds "http://<authority>" to the WHATWG URL parser; net/url is more permissive in several places, so the extra checks below restore the WHATWG answers (see stun_test.go for the recorded comparisons).

func ValidStunURLValue

func ValidStunURLValue(value string) bool

ValidStunURLValue mirrors stunUrlSchema: 1..512 UTF-16 code units plus isValidStunUrl. It is the single owner of that bound; config validates STUN_URLS and the Client's local STUN list through it.

func ValidToken

func ValidToken(value string) bool

ValidToken mirrors tokenSchema: 32..128 code units of [A-Za-z0-9_-].

func ValidViewerGrant

func ValidViewerGrant(value string) bool

ValidViewerGrant mirrors viewerGrantSchema.

func ValidViewerPassword

func ValidViewerPassword(value string) bool

ValidViewerPassword mirrors viewerPasswordSchema.

Types

type AbandonRoomMessage

type AbandonRoomMessage struct {
	Type string `json:"type"`
}

AbandonRoomMessage is { type: "abandon-room" }.

type AuthenticateHostMessage

type AuthenticateHostMessage struct {
	Type                       string           `json:"type"`
	Protocol                   string           `json:"protocol"`
	RoomID                     string           `json:"roomId"`
	Role                       Role             `json:"role"`
	Token                      string           `json:"token"`
	ClientID                   string           `json:"clientId"`
	ShareGeneration            string           `json:"shareGeneration,omitempty"`
	SharingPaused              *bool            `json:"sharingPaused,omitempty"`
	QualitySettings            *QualitySettings `json:"qualitySettings,omitempty"`
	RoutePolicy                RoutePolicy      `json:"routePolicy"`
	ViewerPresence             bool             `json:"viewerPresence,omitempty"`
	ConnectionAttemptProgress4 bool             `json:"connectionAttemptProgress4,omitempty"`
	DisplayName                *DisplayName     `json:"displayName,omitempty"`
	RoomOnly                   bool             `json:"roomOnly,omitempty"`
	RoomSession                bool             `json:"roomSession,omitempty"`
}

AuthenticateHostMessage is the host member of authenticateMessageSchema.

type AuthenticateViewerMessage

type AuthenticateViewerMessage struct {
	Type                       string       `json:"type"`
	Protocol                   string       `json:"protocol"`
	RoomID                     string       `json:"roomId"`
	Role                       Role         `json:"role"`
	ClientID                   string       `json:"clientId"`
	ViewerGrant                string       `json:"viewerGrant,omitempty"`
	ViewerPassword             string       `json:"viewerPassword,omitempty"`
	DisplayName                *DisplayName `json:"displayName,omitempty"`
	ViewerPresence             bool         `json:"viewerPresence,omitempty"`
	ConnectionAttemptProgress4 bool         `json:"connectionAttemptProgress4,omitempty"`
}

AuthenticateViewerMessage is the viewer member of authenticateMessageSchema.

type AuthenticatedHostMessage

type AuthenticatedHostMessage struct {
	Type                          string                     `json:"type"`
	Protocol                      string                     `json:"protocol"`
	PeerID                        string                     `json:"peerId"`
	MaxViewers                    Int                        `json:"maxViewers"`
	EndpointMediaCopyCapacity     Int                        `json:"endpointMediaCopyCapacity"`
	HostOnline                    bool                       `json:"hostOnline"`
	HostPaused                    *bool                      `json:"hostPaused,omitempty"`
	ConnectionID                  *string                    `json:"connectionId"`
	IceConfig                     IceConfig                  `json:"iceConfig"`
	RoutePolicy                   RoutePolicy                `json:"routePolicy"`
	CodeEntryPolicy               CodeEntryPolicy            `json:"codeEntryPolicy"`
	ViewerAuthorizationGeneration string                     `json:"viewerAuthorizationGeneration"`
	MediaMode                     string                     `json:"mediaMode"`
	ShareGeneration               *string                    `json:"shareGeneration"`
	RouteRevision                 Int                        `json:"routeRevision"`
	RouteAssignment               ParticipantRouteAssignment `json:"routeAssignment"`
	QualitySettings               QualitySettings            `json:"qualitySettings"`
	Role                          Role                       `json:"role"`
	ViewerPasswordEnabled         bool                       `json:"viewerPasswordEnabled"`
}

AuthenticatedHostMessage returns the Host's current room and transport facts.

type AuthenticatedViewerMessage

type AuthenticatedViewerMessage struct {
	Type                          string                     `json:"type"`
	Protocol                      string                     `json:"protocol"`
	PeerID                        string                     `json:"peerId"`
	MaxViewers                    Int                        `json:"maxViewers"`
	EndpointMediaCopyCapacity     Int                        `json:"endpointMediaCopyCapacity"`
	HostOnline                    bool                       `json:"hostOnline"`
	HostPaused                    *bool                      `json:"hostPaused,omitempty"`
	ConnectionID                  *string                    `json:"connectionId"`
	IceConfig                     IceConfig                  `json:"iceConfig"`
	RoutePolicy                   RoutePolicy                `json:"routePolicy"`
	CodeEntryPolicy               CodeEntryPolicy            `json:"codeEntryPolicy"`
	ViewerAuthorizationGeneration string                     `json:"viewerAuthorizationGeneration"`
	MediaMode                     string                     `json:"mediaMode"`
	ShareGeneration               *string                    `json:"shareGeneration"`
	RouteRevision                 Int                        `json:"routeRevision"`
	RouteAssignment               ParticipantRouteAssignment `json:"routeAssignment"`
	QualitySettings               QualitySettings            `json:"qualitySettings"`
	Role                          Role                       `json:"role"`
}

AuthenticatedViewerMessage is the viewer member of authenticatedMessageSchema.

type CandidateSignalOrigin

type CandidateSignalOrigin string

CandidateSignalOrigin is CandidateSignalOrigin.

const (
	CandidateOriginEnd       CandidateSignalOrigin = "end"
	CandidateOriginOrdinary  CandidateSignalOrigin = "ordinary"
	CandidateOriginPredicted CandidateSignalOrigin = "predicted"
)

Candidate signal origins.

func CandidateSignalOriginOf

func CandidateSignalOriginOf(candidate string) CandidateSignalOrigin

CandidateSignalOriginOf treats an empty string as TypeScript null (both yield "end").

type ClientMessage

type ClientMessage interface {
	// contains filtered or unexported methods
}

ClientMessage is one member of clientMessageSchema. The interface is sealed: only the message structs in this file implement it.

func DecodeClientMessage

func DecodeClientMessage(data []byte) (ClientMessage, error)

DecodeClientMessage parses JSON and validates the message schema. Every member carries a distinct `type` literal, so that key resolves the union.

type ClientRestartRequestMessage

type ClientRestartRequestMessage struct {
	Type         string `json:"type"`
	TargetPeerID string `json:"targetPeerId,omitempty"`
	ConnectionID string `json:"connectionId"`
	Rebuild      bool   `json:"rebuild"`
}

ClientRestartRequestMessage is the client "restart-request" message.

type ClientSignalMessage

type ClientSignalMessage struct {
	Type         string        `json:"type"`
	TargetPeerID string        `json:"targetPeerId,omitempty"`
	Payload      SignalPayload `json:"payload"`
}

ClientSignalMessage is the client "signal" message.

type CodeEntryPolicy

type CodeEntryPolicy = string

CodeEntryPolicy mirrors codeEntryPolicySchema.

const (
	CodeEntryOpen    CodeEntryPolicy = "open"
	CodeEntryPrivate CodeEntryPolicy = "private"
)

Code entry policies.

type CodeEntryPolicyUpdatedResponse

type CodeEntryPolicyUpdatedResponse struct {
	Type                  string          `json:"type"`
	CodeEntryPolicy       CodeEntryPolicy `json:"codeEntryPolicy"`
	ViewerPasswordEnabled bool            `json:"viewerPasswordEnabled"`
}

CodeEntryPolicyUpdatedResponse is type "code-entry-policy-updated".

type ConnectionAttempt

type ConnectionAttempt struct {
	Current Int `json:"current"`
	Total   Int `json:"total"`
}

ConnectionAttempt mirrors preparedRouteCandidateSchema.connectionAttempt.

func (*ConnectionAttempt) UnmarshalJSON

func (v *ConnectionAttempt) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CreateRoomRequest

type CreateRoomRequest struct {
	CodeEntryPolicy CodeEntryPolicy  `json:"codeEntryPolicy"`
	RoomPassword    Nullable[string] `json:"roomPassword,omitzero"`
	PreferredRoomID string           `json:"preferredRoomId,omitempty"`
}

CreateRoomRequest mirrors createRoomRequestSchema.

func DecodeCreateRoomRequest

func DecodeCreateRoomRequest(data []byte) (CreateRoomRequest, error)

DecodeCreateRoomRequest parses createRoomRequestSchema.

type CreateRoomResponse

type CreateRoomResponse struct {
	RoomID          string          `json:"roomId"`
	HostToken       string          `json:"hostToken"`
	InviteURL       string          `json:"inviteUrl"`
	CodeEntryPolicy CodeEntryPolicy `json:"codeEntryPolicy"`
}

CreateRoomResponse mirrors createRoomResponseSchema.

type DisplayName

type DisplayName string

DisplayName mirrors displayNameSchema: 1..96 UTF-16 code units that normalizeDisplayName leaves unchanged.

func (*DisplayName) UnmarshalJSON

func (d *DisplayName) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type EndpointMediaCopyPhase

type EndpointMediaCopyPhase string

EndpointMediaCopyPhase is EndpointMediaCopyPhase.

const (
	EndpointMediaCopySteady     EndpointMediaCopyPhase = "steady"
	EndpointMediaCopyTransition EndpointMediaCopyPhase = "transition"
)

Endpoint media copy phases.

type ErrorMessage

type ErrorMessage struct {
	Type    string `json:"type"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

ErrorMessage is { type: "error", code, message }.

type HostStatusMessage

type HostStatusMessage struct {
	Type   string `json:"type"`
	Online bool   `json:"online"`
	Paused bool   `json:"paused"`
}

HostStatusMessage reports host presence and pause state.

type IceCandidate

type IceCandidate struct {
	Candidate        string           `json:"candidate"`
	SDPMid           Nullable[string] `json:"sdpMid,omitzero"`
	SDPMLineIndex    Nullable[Int]    `json:"sdpMLineIndex,omitzero"`
	UsernameFragment Nullable[string] `json:"usernameFragment,omitzero"`
}

IceCandidate mirrors iceCandidateSchema.

func (*IceCandidate) UnmarshalJSON

func (v *IceCandidate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type IceConfig

type IceConfig struct {
	IceServers            []IceServer `json:"iceServers"`
	NatPredictionStunURLs []string    `json:"natPredictionStunUrls"`
}

IceConfig mirrors iceConfigSchema.

func (IceConfig) MarshalJSON

func (v IceConfig) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*IceConfig) UnmarshalJSON

func (v *IceConfig) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type IceServer

type IceServer struct {
	URLs IceServerURLs `json:"urls"`
}

IceServer mirrors iceServerSchema.

func (*IceServer) UnmarshalJSON

func (v *IceServer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type IceServerURLs

type IceServerURLs struct {
	Single string
	List   []string
}

IceServerURLs mirrors z.union([stunUrlSchema, z.array(stunUrlSchema)]).

func IceServerURLList

func IceServerURLList(urls ...string) IceServerURLs

IceServerURLList builds the array form.

func (IceServerURLs) MarshalJSON

func (v IceServerURLs) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*IceServerURLs) UnmarshalJSON

func (v *IceServerURLs) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Int

type Int int64

Int is a JSON number restricted to an integral value, mirroring zod's z.number().int(): 5.0 is an integer, 5.5 is not, and values outside the safe integer range are rejected (zod 4 rejects them too, and every `.int()` field in the contract is bounded by MAX_SAFE_INTEGER anyway).

func (*Int) UnmarshalJSON

func (v *Int) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type InteractionPayload added in v1.7.0

type InteractionPayload struct {
	Kind         string `json:"kind"`
	Text         string `json:"text,omitempty"`
	Reaction     string `json:"reaction,omitempty"`
	TargetPeerID string `json:"targetPeerId,omitempty"`
}

func (*InteractionPayload) UnmarshalJSON added in v1.7.0

func (payload *InteractionPayload) UnmarshalJSON(data []byte) error

type InteractionSender added in v1.7.0

type InteractionSender struct {
	PeerID      string      `json:"peerId"`
	Role        Role        `json:"role"`
	DisplayName DisplayName `json:"displayName"`
}

func (*InteractionSender) UnmarshalJSON added in v1.7.0

func (sender *InteractionSender) UnmarshalJSON(data []byte) error

type MediaRouteUpstream

type MediaRouteUpstream struct {
	Kind   string `json:"kind"`
	PeerID string `json:"peerId,omitempty"`
}

MediaRouteUpstream mirrors mediaRouteUpstreamSchema.

func NoUpstream

func NoUpstream() MediaRouteUpstream

NoUpstream builds { kind: "none" }.

func PeerUpstream

func PeerUpstream(peerID string) MediaRouteUpstream

PeerUpstream builds { kind: "peer", peerId }.

func SfuUpstream

func SfuUpstream() MediaRouteUpstream

SfuUpstream builds { kind: "sfu" }.

func (*MediaRouteUpstream) UnmarshalJSON

func (v *MediaRouteUpstream) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Nullable

type Nullable[T any] struct {
	Set   bool
	Value *T
}

Nullable carries a value that is both `.nullable()` and `.optional()`, so the three wire states (absent, null, value) survive a decode/encode round trip.

func (Nullable[T]) IsZero

func (n Nullable[T]) IsZero() bool

IsZero reports whether the key was absent, so `omitzero` drops it.

func (Nullable[T]) MarshalJSON

func (n Nullable[T]) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*Nullable[T]) UnmarshalJSON

func (n *Nullable[T]) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Num

type Num float64

Num is a JSON number restricted to a finite value, mirroring zod's z.number().finite().

func (*Num) UnmarshalJSON

func (v *Num) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ParticipantPresenceEntry

type ParticipantPresenceEntry struct {
	Role        Role               `json:"role"`
	PeerID      string             `json:"peerId"`
	DisplayName DisplayName        `json:"displayName"`
	Upstream    MediaRouteUpstream `json:"upstream"`
	MediaReady  bool               `json:"mediaReady,omitempty"`
}

ParticipantPresenceEntry mirrors participantPresenceEntrySchema. The viewer variant is viewerPresenceEntrySchema.

func HostPresenceEntry

func HostPresenceEntry(peerID string, displayName DisplayName) ParticipantPresenceEntry

HostPresenceEntry builds the host entry, whose upstream is always { kind: "none" } and which never carries mediaReady.

func NewViewerPresenceEntry

func NewViewerPresenceEntry(
	peerID string, displayName DisplayName, upstream MediaRouteUpstream, mediaReady bool,
) ParticipantPresenceEntry

NewViewerPresenceEntry builds a viewer entry; mediaReady is emitted only when true, matching `...(mediaReady ? { mediaReady: true } : {})`.

func (*ParticipantPresenceEntry) UnmarshalJSON

func (v *ParticipantPresenceEntry) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ParticipantRouteAssignment

type ParticipantRouteAssignment struct {
	Upstream                 MediaRouteUpstream `json:"upstream"`
	ChildPeerIDs             []string           `json:"childPeerIds"`
	SfuPublicationGeneration *string            `json:"sfuPublicationGeneration"`
}

ParticipantRouteAssignment mirrors participantRouteAssignmentSchema.

func (ParticipantRouteAssignment) MarshalJSON

func (v ParticipantRouteAssignment) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*ParticipantRouteAssignment) UnmarshalJSON

func (v *ParticipantRouteAssignment) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type PauseSharingSourceMessage

type PauseSharingSourceMessage struct {
	Type            string `json:"type"`
	ShareGeneration string `json:"shareGeneration"`
}

PauseSharingSourceMessage asks the host to pause its capture source.

type PreparedRouteCandidate

type PreparedRouteCandidate struct {
	ChildPeerID       string             `json:"childPeerId"`
	ConnectionID      string             `json:"connectionId"`
	Transport         string             `json:"transport"`
	QualityProbe      bool               `json:"qualityProbe"`
	ConnectionAttempt *ConnectionAttempt `json:"connectionAttempt,omitempty"`
}

PreparedRouteCandidate mirrors preparedRouteCandidateSchema.

func (*PreparedRouteCandidate) UnmarshalJSON

func (v *PreparedRouteCandidate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type QualitySettings

type QualitySettings struct {
	Resolution            string `json:"resolution"`
	MaxFramerate          Int    `json:"maxFramerate"`
	MaxBitrate            Int    `json:"maxBitrate"`
	DegradationPreference string `json:"degradationPreference"`
	ScreenAudioQuality    string `json:"screenAudioQuality,omitempty"`
}

QualitySettings mirrors qualitySettingsSchema.

func (*QualitySettings) UnmarshalJSON

func (v *QualitySettings) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type QualitySettingsMessage

type QualitySettingsMessage struct {
	Type            string          `json:"type"`
	QualitySettings QualitySettings `json:"qualitySettings"`
}

QualitySettingsMessage broadcasts the host's quality settings.

type RefreshSfuMessage

type RefreshSfuMessage struct {
	Type     string `json:"type"`
	Revision Int    `json:"revision"`
}

RefreshSfuMessage is { type: "refresh-sfu", revision }.

type RelayCapacityMessage

type RelayCapacityMessage struct {
	Type            string `json:"type"`
	DownstreamEdges Int    `json:"downstreamEdges"`
}

RelayCapacityMessage is { type: "relay-capacity", downstreamEdges }.

type ReplaceRoomRequest

type ReplaceRoomRequest struct {
	CodeEntryPolicy CodeEntryPolicy  `json:"codeEntryPolicy"`
	RoomPassword    Nullable[string] `json:"roomPassword,omitzero"`
}

ReplaceRoomRequest mirrors replaceRoomRequestSchema.

func DecodeReplaceRoomRequest

func DecodeReplaceRoomRequest(data []byte) (ReplaceRoomRequest, error)

DecodeReplaceRoomRequest parses replaceRoomRequestSchema.

type RequestRouteDiagnosticMessage

type RequestRouteDiagnosticMessage struct {
	Type string `json:"type"`
}

RequestRouteDiagnosticMessage is { type: "request-route-diagnostic" }.

type ResetSenderQualityMessage

type ResetSenderQualityMessage struct {
	Type string `json:"type"`
}

ResetSenderQualityMessage is { type: "reset-sender-quality" }.

type RevokeViewerGrantRequest

type RevokeViewerGrantRequest struct {
	Action string `json:"action"`
}

RevokeViewerGrantRequest is action "revoke-viewer-grant".

type Role

type Role = string

Role mirrors roleSchema.

const (
	RoleHost   Role = "host"
	RoleViewer Role = "viewer"
)

Roles.

type RoomAccessUpdateRequest

type RoomAccessUpdateRequest interface {
	// contains filtered or unexported methods
}

RoomAccessUpdateRequest is one member of roomAccessUpdateRequestSchema.

func DecodeRoomAccessUpdateRequest

func DecodeRoomAccessUpdateRequest(data []byte) (RoomAccessUpdateRequest, error)

DecodeRoomAccessUpdateRequest parses roomAccessUpdateRequestSchema.

type RoomAccessUpdateResponse

type RoomAccessUpdateResponse interface {
	// contains filtered or unexported methods
}

RoomAccessUpdateResponse is one member of roomAccessUpdateResponseSchema.

type RoomClosedMessage

type RoomClosedMessage struct {
	Type   string `json:"type"`
	Reason string `json:"reason"`
}

RoomClosedMessage is { type: "room-closed", reason }.

type RoomInteractionMessage added in v1.7.0

type RoomInteractionMessage struct {
	Type       string             `json:"type"`
	ID         string             `json:"id"`
	RequestID  string             `json:"requestId"`
	OccurredAt Int                `json:"occurredAt"`
	Sender     InteractionSender  `json:"sender"`
	Payload    InteractionPayload `json:"payload"`
}

type RoomInteractionRejectedMessage added in v1.7.0

type RoomInteractionRejectedMessage struct {
	Type      string `json:"type"`
	RequestID string `json:"requestId"`
	Reason    string `json:"reason"`
}

type RoomInteractionsReadyMessage added in v1.7.0

type RoomInteractionsReadyMessage struct {
	Type       string `json:"type"`
	ServerTime Int    `json:"serverTime"`
}

type RotateViewerGrantRequest

type RotateViewerGrantRequest struct {
	Action string `json:"action"`
}

RotateViewerGrantRequest is action "rotate-viewer-grant".

type RouteDiagnosticChild

type RouteDiagnosticChild struct {
	Ordinal             Int                     `json:"ordinal"`
	Parent              RouteDiagnosticParent   `json:"parent"`
	EffectiveCapacity   Int                     `json:"effectiveCapacity"`
	ChildCount          Int                     `json:"childCount"`
	DemandAgeMs         *Int                    `json:"demandAgeMs"`
	QueueWaitMs         *Int                    `json:"queueWaitMs"`
	CandidateStartMs    *Int                    `json:"candidateStartMs"`
	FirstDecodedFrameMs *Int                    `json:"firstDecodedFrameMs"`
	FinalMs             *Int                    `json:"finalMs"`
	FinalRoute          string                  `json:"finalRoute"`
	RejectionBucket     string                  `json:"rejectionBucket"`
	Quality             *RouteDiagnosticQuality `json:"quality"`
}

RouteDiagnosticChild mirrors routeDiagnosticChildSchema.

func (*RouteDiagnosticChild) UnmarshalJSON

func (v *RouteDiagnosticChild) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type RouteDiagnosticOperation

type RouteDiagnosticOperation struct {
	ChildOrdinal   Int    `json:"childOrdinal"`
	Reason         string `json:"reason"`
	Stage          string `json:"stage"`
	Cursor         Int    `json:"cursor"`
	CandidateCount Int    `json:"candidateCount"`
}

RouteDiagnosticOperation mirrors routeDiagnosticOperationSchema.

func (*RouteDiagnosticOperation) UnmarshalJSON

func (v *RouteDiagnosticOperation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type RouteDiagnosticParent

type RouteDiagnosticParent struct {
	Kind    string `json:"kind"`
	Ordinal Int    `json:"ordinal,omitempty"`
}

RouteDiagnosticParent mirrors routeDiagnosticParentSchema.

func (*RouteDiagnosticParent) UnmarshalJSON

func (v *RouteDiagnosticParent) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type RouteDiagnosticQuality

type RouteDiagnosticQuality struct {
	EligibleWindows    Int `json:"eligibleWindows"`
	EligibleDurationMs Int `json:"eligibleDurationMs"`
	FreezeWindows      Int `json:"freezeWindows"`
	FreezeCount        Int `json:"freezeCount"`
	FreezeDurationMs   Int `json:"freezeDurationMs"`
	PauseCount         Int `json:"pauseCount"`
	PauseDurationMs    Int `json:"pauseDurationMs"`
}

RouteDiagnosticQuality mirrors routeDiagnosticQualitySchema.

func (*RouteDiagnosticQuality) UnmarshalJSON

func (v *RouteDiagnosticQuality) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type RouteDiagnosticSnapshot

type RouteDiagnosticSnapshot struct {
	Children  []RouteDiagnosticChild    `json:"children"`
	Operation *RouteDiagnosticOperation `json:"operation"`
}

RouteDiagnosticSnapshot mirrors routeDiagnosticSnapshotSchema.

func (RouteDiagnosticSnapshot) MarshalJSON

func (v RouteDiagnosticSnapshot) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*RouteDiagnosticSnapshot) UnmarshalJSON

func (v *RouteDiagnosticSnapshot) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type RouteDiagnosticSnapshotMessage

type RouteDiagnosticSnapshotMessage struct {
	Type     string                  `json:"type"`
	Snapshot RouteDiagnosticSnapshot `json:"snapshot"`
}

RouteDiagnosticSnapshotMessage carries the privacy-safe route snapshot.

type RouteFailedMessage

type RouteFailedMessage struct {
	Type         string  `json:"type"`
	Revision     Int     `json:"revision"`
	Phase        string  `json:"phase"`
	ConnectionID *string `json:"connectionId"`
}

RouteFailedMessage is { type: "route-failed", revision, phase, connectionId }.

type RouteMediaUnavailableMessage

type RouteMediaUnavailableMessage struct {
	Type     string `json:"type"`
	Revision Int    `json:"revision"`
}

RouteMediaUnavailableMessage is the "route-media-unavailable" message.

type RoutePolicy

type RoutePolicy struct {
	PeerOnly             bool `json:"peerOnly"`
	TopologyOptimization bool `json:"topologyOptimization"`
	NatPrediction        bool `json:"natPrediction"`
}

RoutePolicy mirrors routePolicySchema.

func (*RoutePolicy) UnmarshalJSON

func (v *RoutePolicy) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type RoutePolicyMessage

type RoutePolicyMessage struct {
	Type            string      `json:"type"`
	ShareGeneration string      `json:"shareGeneration"`
	RoutePolicy     RoutePolicy `json:"routePolicy"`
}

RoutePolicyMessage broadcasts the host's route policy.

type RouteReadyMessage

type RouteReadyMessage struct {
	Type            string `json:"type"`
	Revision        Int    `json:"revision"`
	Phase           string `json:"phase"`
	QualityApproved bool   `json:"qualityApproved,omitempty"`
}

RouteReadyMessage is { type: "route-ready", revision, phase, qualityApproved? }.

type RouteStatusMessage

type RouteStatusMessage struct {
	Type     string `json:"type"`
	Revision Int    `json:"revision"`
	State    string `json:"state"`
	Reason   string `json:"reason"`
}

RouteStatusMessage is the crossed (state, reason) union: "waiting" pairs with "sfu-admission" and "failed" pairs with "route-exhausted".

type RouteTransportConnectedMessage

type RouteTransportConnectedMessage struct {
	Type         string `json:"type"`
	Revision     Int    `json:"revision"`
	ConnectionID string `json:"connectionId"`
}

RouteTransportConnectedMessage is the "route-transport-connected" message.

type RouteUpdateActiveMessage

type RouteUpdateActiveMessage struct {
	Type       string                     `json:"type"`
	Revision   Int                        `json:"revision"`
	Phase      string                     `json:"phase"`
	Assignment ParticipantRouteAssignment `json:"assignment"`
}

RouteUpdateActiveMessage is the phase "active" member of route-update.

type RouteUpdatePrepareMessage

type RouteUpdatePrepareMessage struct {
	Type       string                     `json:"type"`
	Revision   Int                        `json:"revision"`
	Phase      string                     `json:"phase"`
	Assignment ParticipantRouteAssignment `json:"assignment"`
	Candidate  PreparedRouteCandidate     `json:"candidate"`
}

RouteUpdatePrepareMessage is the phase "prepare" member of route-update.

type RuntimeCapabilities

type RuntimeCapabilities struct {
	ConnectionAttemptProgress4 bool `json:"connectionAttemptProgress4,omitempty"`
	Sfu                        bool `json:"sfu"`
	SfuOnly                    bool `json:"sfuOnly,omitempty"`
	NatPrediction              bool `json:"natPrediction"`
	RoomInteractions           bool `json:"roomInteractions,omitempty"`
	HostRoomSession            bool `json:"hostRoomSession,omitempty"`
}

RuntimeCapabilities mirrors runtimeCapabilitiesSchema.

func (*RuntimeCapabilities) UnmarshalJSON

func (v *RuntimeCapabilities) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type SendRoomInteractionMessage added in v1.7.0

type SendRoomInteractionMessage struct {
	Type      string             `json:"type"`
	RequestID string             `json:"requestId"`
	Payload   InteractionPayload `json:"payload"`
}

type SenderQualityDiagnostics

type SenderQualityDiagnostics struct {
	NatTraversalPath           string        `json:"natTraversalPath"`
	Reason                     *string       `json:"reason"`
	FramesPerSecond            *Num          `json:"framesPerSecond"`
	BitrateKbps                *Num          `json:"bitrateKbps"`
	CaptureFramesPerSecond     Nullable[Num] `json:"captureFramesPerSecond,omitzero"`
	MediaSourceFramesPerSecond Nullable[Num] `json:"mediaSourceFramesPerSecond,omitzero"`
	Width                      Nullable[Int] `json:"width,omitzero"`
	Height                     Nullable[Int] `json:"height,omitzero"`
	VideoEncodingCount         Nullable[Int] `json:"videoEncodingCount,omitzero"`
	ActiveVideoEncodingCount   Nullable[Int] `json:"activeVideoEncodingCount,omitzero"`
	AvailableOutgoingKbps      Nullable[Num] `json:"availableOutgoingKbps,omitzero"`
	RttMs                      Nullable[Num] `json:"rttMs,omitzero"`
	PacketLossPercent          Nullable[Num] `json:"packetLossPercent,omitzero"`
}

SenderQualityDiagnostics mirrors senderQualityDiagnosticsSchema.

func (*SenderQualityDiagnostics) UnmarshalJSON

func (v *SenderQualityDiagnostics) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type SenderQualityEvidenceMessage

type SenderQualityEvidenceMessage struct {
	Type              string                   `json:"type"`
	ChildPeerID       string                   `json:"childPeerId"`
	ConnectionID      string                   `json:"connectionId"`
	RtpStatsID        *string                  `json:"rtpStatsId"`
	TrackIdentifier   *string                  `json:"trackIdentifier"`
	SampleTimestampMs *Num                     `json:"sampleTimestampMs"`
	RouteRevision     Int                      `json:"routeRevision"`
	State             string                   `json:"state"`
	Diagnostics       SenderQualityDiagnostics `json:"diagnostics"`
}

SenderQualityEvidenceMessage is senderQualityEvidenceMessageSchema.

type ServerMessage

type ServerMessage interface {
	// contains filtered or unexported methods
}

ServerMessage is one member of serverMessageSchema. The interface is sealed: only the message structs in this file implement it.

func DecodeServerMessage

func DecodeServerMessage(data []byte) (ServerMessage, error)

DecodeServerMessage supports replaying the shared wire fixture from Go. The server never reads its own messages in production.

type ServerRestartRequestMessage

type ServerRestartRequestMessage struct {
	Type         string `json:"type"`
	FromPeerID   string `json:"fromPeerId"`
	ConnectionID string `json:"connectionId"`
	Rebuild      bool   `json:"rebuild"`
}

ServerRestartRequestMessage is the forwarded "restart-request" message.

type ServerSignalMessage

type ServerSignalMessage struct {
	Type       string        `json:"type"`
	FromPeerID string        `json:"fromPeerId"`
	Payload    SignalPayload `json:"payload"`
}

ServerSignalMessage is the forwarded "signal" message.

type ServerViewerQualityEvidenceMessage

type ServerViewerQualityEvidenceMessage struct {
	Type         string                       `json:"type"`
	ViewerPeerID string                       `json:"viewerPeerId"`
	Upstream     MediaRouteUpstream           `json:"upstream"`
	Guard        ViewerQualityEvidenceGuard   `json:"guard"`
	Sequence     Int                          `json:"sequence"`
	WindowMs     Int                          `json:"windowMs"`
	Metrics      ViewerQualityEvidenceMetrics `json:"metrics"`
}

ServerViewerQualityEvidenceMessage is the forwarded evidence envelope.

type SessionDescription

type SessionDescription struct {
	Type string `json:"type"`
	SDP  string `json:"sdp"`
}

SessionDescription mirrors sessionDescriptionSchema.

func (*SessionDescription) UnmarshalJSON

func (v *SessionDescription) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type SetCodeEntryPolicyRequest

type SetCodeEntryPolicyRequest struct {
	Action string          `json:"action"`
	Policy CodeEntryPolicy `json:"policy"`
}

SetCodeEntryPolicyRequest is action "set-code-entry-policy".

type SetDisplayNameMessage

type SetDisplayNameMessage struct {
	Type        string      `json:"type"`
	DisplayName DisplayName `json:"displayName"`
}

SetDisplayNameMessage is { type: "set-display-name", displayName }.

type SetQualitySettingsMessage

type SetQualitySettingsMessage struct {
	Type            string          `json:"type"`
	QualitySettings QualitySettings `json:"qualitySettings"`
}

SetQualitySettingsMessage is { type: "set-quality-settings", qualitySettings }.

type SetSharingPausedMessage

type SetSharingPausedMessage struct {
	Type            string `json:"type"`
	ShareGeneration string `json:"shareGeneration"`
	Paused          bool   `json:"paused"`
}

SetSharingPausedMessage is { type: "set-sharing-paused", shareGeneration, paused }.

type SetViewerPasswordRequest

type SetViewerPasswordRequest struct {
	Action   string  `json:"action"`
	Password *string `json:"password"`
}

SetViewerPasswordRequest is action "set-viewer-password".

type SfuConfigMessage

type SfuConfigMessage struct {
	Type                  string `json:"type"`
	Revision              Int    `json:"revision"`
	PublicationGeneration string `json:"publicationGeneration"`
	ConnectionID          string `json:"connectionId"`
}

SfuConfigMessage authorizes one embedded media connection.

type SfuLayer

type SfuLayer struct {
	RID     string `json:"rid"`
	Width   Int    `json:"width"`
	Height  Int    `json:"height"`
	Bitrate Int    `json:"bitrate"`
}

func (*SfuLayer) UnmarshalJSON

func (value *SfuLayer) UnmarshalJSON(data []byte) error

type SfuMedia

type SfuMedia struct {
	Codec        string     `json:"codec"`
	Layers       []SfuLayer `json:"layers"`
	Audio        bool       `json:"audio"`
	AudioBitrate Int        `json:"audioBitrate"`
}

SfuMedia describes the publisher's real encodings, ordered low to high.

func (*SfuMedia) UnmarshalJSON

func (value *SfuMedia) UnmarshalJSON(data []byte) error

type SfuPublisherQualityEvidenceMessage

type SfuPublisherQualityEvidenceMessage struct {
	Type                  string                   `json:"type"`
	PublicationGeneration string                   `json:"publicationGeneration"`
	RouteRevision         Int                      `json:"routeRevision"`
	State                 string                   `json:"state"`
	SampleTimestampMs     *Num                     `json:"sampleTimestampMs"`
	Diagnostics           SenderQualityDiagnostics `json:"diagnostics"`
}

SfuPublisherQualityEvidenceMessage is sfuPublisherQualityEvidenceMessageSchema.

type SfuSignalMessage

type SfuSignalMessage struct {
	Type                  string              `json:"type"`
	Revision              Int                 `json:"revision"`
	PublicationGeneration string              `json:"publicationGeneration"`
	ConnectionID          string              `json:"connectionId"`
	Kind                  string              `json:"kind"`
	Description           *SessionDescription `json:"description,omitempty"`
	Candidate             *IceCandidate       `json:"candidate,omitempty"`
	Media                 *SfuMedia           `json:"media,omitempty"`
	ActiveCount           *Int                `json:"activeCount,omitempty"`
}

SfuSignalMessage travels only on the room's authenticated WebSocket.

type SharingStartFailedMessage added in v1.7.0

type SharingStartFailedMessage struct {
	Type            string `json:"type"`
	ShareGeneration string `json:"shareGeneration"`
	Code            string `json:"code"`
}

type SharingStartedMessage added in v1.7.0

type SharingStartedMessage struct {
	Type            string                     `json:"type"`
	ShareGeneration string                     `json:"shareGeneration"`
	RoutePolicy     RoutePolicy                `json:"routePolicy"`
	RouteRevision   Int                        `json:"routeRevision"`
	RouteAssignment ParticipantRouteAssignment `json:"routeAssignment"`
	QualitySettings QualitySettings            `json:"qualitySettings"`
	Paused          bool                       `json:"paused"`
}

SharingStartedMessage acknowledges a new media publication on an existing Host session.

type SharingStoppedMessage

type SharingStoppedMessage struct {
	Type string `json:"type"`
}

SharingStoppedMessage is { type: "sharing-stopped" }.

type SignalCloseCode

type SignalCloseCode int

SignalCloseCode is one of SIGNAL_CLOSE_CODES.

const (
	SignalCloseServiceRestart       SignalCloseCode = 1012
	SignalCloseSessionReplaced      SignalCloseCode = 4001
	SignalCloseClientReconnect      SignalCloseCode = 4002
	SignalCloseAuthenticationFailed SignalCloseCode = 4003
	SignalCloseViewerAccessRevoked  SignalCloseCode = 4004
)

SIGNAL_CLOSE_CODES.

type SignalPayload

type SignalPayload struct {
	Kind         string
	ConnectionID string
	Description  *SessionDescription
	Candidate    *IceCandidate
}

SignalPayload mirrors signalPayloadSchema. Candidate is nil for the JSON null the "candidate" variant requires.

func (SignalPayload) MarshalJSON

func (v SignalPayload) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*SignalPayload) UnmarshalJSON

func (v *SignalPayload) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type SignalingChallengeMessage

type SignalingChallengeMessage struct {
	Type     string `json:"type"`
	Sequence Int    `json:"sequence"`
}

SignalingChallengeMessage is { type: "signaling-challenge", sequence }.

type SignalingChallengeResponseMessage

type SignalingChallengeResponseMessage struct {
	Type     string `json:"type"`
	Sequence Int    `json:"sequence"`
}

SignalingChallengeResponseMessage is the challenge echo.

type StartSharingMessage added in v1.7.0

type StartSharingMessage struct {
	Type            string           `json:"type"`
	ShareGeneration string           `json:"shareGeneration"`
	SharingPaused   bool             `json:"sharingPaused,omitempty"`
	QualitySettings *QualitySettings `json:"qualitySettings,omitempty"`
	RoutePolicy     RoutePolicy      `json:"routePolicy"`
}

StartSharingMessage begins a new media publication on an existing Host room session.

type StopSharingMessage

type StopSharingMessage struct {
	Type            string `json:"type"`
	ShareGeneration string `json:"shareGeneration,omitempty"`
}

StopSharingMessage is { type: "stop-sharing", shareGeneration? }.

type SubscribeRoomInteractionsMessage added in v1.7.0

type SubscribeRoomInteractionsMessage struct {
	Type string `json:"type"`
}

type ViewerGrantRevokedMessage

type ViewerGrantRevokedMessage struct {
	Type                          string `json:"type"`
	ViewerAuthorizationGeneration string `json:"viewerAuthorizationGeneration"`
}

ViewerGrantRevokedMessage announces a superseded viewer authorization.

type ViewerGrantUpdatedResponse

type ViewerGrantUpdatedResponse struct {
	Type                          string  `json:"type"`
	ViewerAuthorizationGeneration string  `json:"viewerAuthorizationGeneration"`
	InviteURL                     *string `json:"inviteUrl"`
}

ViewerGrantUpdatedResponse is type "viewer-grant-updated". InviteURL is nil for the explicit null a revoke returns.

type ViewerPasswordUpdatedResponse

type ViewerPasswordUpdatedResponse struct {
	Type    string `json:"type"`
	Enabled bool   `json:"enabled"`
}

ViewerPasswordUpdatedResponse is type "viewer-password-updated".

type ViewerPresenceMessage

type ViewerPresenceMessage struct {
	Type    string                     `json:"type"`
	Viewers []ParticipantPresenceEntry `json:"viewers"`
}

ViewerPresenceMessage carries the ordered participant roster.

func (ViewerPresenceMessage) MarshalJSON

func (v ViewerPresenceMessage) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type ViewerQualityEvidenceGuard

type ViewerQualityEvidenceGuard struct {
	ConnectionID      string `json:"connectionId"`
	RouteRevision     Int    `json:"routeRevision"`
	PresentationEpoch Int    `json:"presentationEpoch"`
}

ViewerQualityEvidenceGuard mirrors viewerQualityEvidenceGuardSchema.

func (*ViewerQualityEvidenceGuard) UnmarshalJSON

func (v *ViewerQualityEvidenceGuard) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ViewerQualityEvidenceMessage

type ViewerQualityEvidenceMessage struct {
	Type     string                       `json:"type"`
	Guard    ViewerQualityEvidenceGuard   `json:"guard"`
	Sequence Int                          `json:"sequence"`
	WindowMs Int                          `json:"windowMs"`
	Metrics  ViewerQualityEvidenceMetrics `json:"metrics"`
}

ViewerQualityEvidenceMessage is viewerQualityEvidenceMessageSchema.

type ViewerQualityEvidenceMetrics

type ViewerQualityEvidenceMetrics struct {
	NatTraversalPath             string  `json:"natTraversalPath"`
	Width                        *Int    `json:"width"`
	Height                       *Int    `json:"height"`
	FramesPerSecond              *Num    `json:"framesPerSecond"`
	BitrateKbps                  *Num    `json:"bitrateKbps"`
	PacketsReceivedDelta         *Int    `json:"packetsReceivedDelta"`
	PacketsLostDelta             *Int    `json:"packetsLostDelta"`
	RttMs                        *Num    `json:"rttMs"`
	JitterMs                     *Num    `json:"jitterMs"`
	FramesDecodedDelta           *Int    `json:"framesDecodedDelta"`
	FramesDroppedDelta           *Int    `json:"framesDroppedDelta"`
	DecodeMsPerFrame             *Num    `json:"decodeMsPerFrame"`
	FreezeCountDelta             *Int    `json:"freezeCountDelta"`
	FreezeDurationMsDelta        *Num    `json:"freezeDurationMsDelta"`
	PauseCountDelta              *Int    `json:"pauseCountDelta"`
	PauseDurationMsDelta         *Num    `json:"pauseDurationMsDelta"`
	Codec                        *string `json:"codec"`
	CodecProfile                 *string `json:"codecProfile"`
	CodecParameters              *string `json:"codecParameters"`
	AudioBitrateKbps             *Num    `json:"audioBitrateKbps"`
	AudioPacketLossPercent       *Num    `json:"audioPacketLossPercent"`
	AudioJitterMs                *Num    `json:"audioJitterMs"`
	AudioVideoPlayoutDeltaMs     *Num    `json:"audioVideoPlayoutDeltaMs"`
	VideoJitterBufferDelayMs     *Num    `json:"videoJitterBufferDelayMs"`
	AudioJitterBufferDelayMs     *Num    `json:"audioJitterBufferDelayMs"`
	AudioConcealedSamplesPercent *Num    `json:"audioConcealedSamplesPercent"`
	AudioConcealmentEventsDelta  *Int    `json:"audioConcealmentEventsDelta"`
	AudioCodec                   *string `json:"audioCodec"`
}

ViewerQualityEvidenceMetrics mirrors viewerQualityEvidenceMetricsSchema.

func (*ViewerQualityEvidenceMetrics) UnmarshalJSON

func (v *ViewerQualityEvidenceMetrics) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

Jump to

Keyboard shortcuts

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