Help us shape the future of Go! Take the 2026 Go Developer Survey

clientreg

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package clientreg is the data-driven client capability engine. One ordered registry matches every client. Roles share that matcher: policy (Dolby Vision profiles, subtitles, family), playback (codecs and limits for clients that send no profile), patch (narrow hardware facts) and quirk (a named flag, including a wire-protocol quirk). Owner overrides apply to the matched policy or playback id. Runtime declarations are applied by callers after this package returns.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasQuirk

func HasQuirk(id Identity, name string) bool

HasQuirk reports whether a named quirk matches id.

func Matches

func Matches(m Match, id Identity) bool

Matches reports whether m matches id.

func OverrideApplies

func OverrideApplies(o core.ClientCapabilityOverride, recordIDs []string, id Identity) bool

OverrideApplies reports whether o edits the record ids for this client. An id matches the playback record or the policy record. Product, platform, device and version narrow it further. An override with no id and no matcher matches nothing.

func Version

func Version() int

Version is the embedded registry generation.

Types

type Identity

type Identity struct {
	Product, Platform, Device, Model, Version string
}

Identity is the client a match rule sees.

type Match

type Match struct {
	All   []Match `json:"all,omitempty"`
	Any   []Match `json:"any,omitempty"`
	None  []Match `json:"none,omitempty"`
	Field string  `json:"field,omitempty"`
	Op    string  `json:"op,omitempty"`
	Value string  `json:"value,omitempty"`
}

Match is one rule. A leaf compares Field. All, Any and None combine rules. An empty match matches every client and is the registry's fallback.

type Result

type Result struct {
	ID                  string
	Family              string
	Notes               string
	Video               []string
	Audio               []string
	Containers          []string
	Subtitles           []string
	DolbyVisionProfiles []int
	MaxHeight           int
	MaxBitrateKbps      int
	HDR10               bool
	DolbyVision         bool
	// HeightLocked is set when an owner override chose the height.
	HeightLocked bool
}

Result is one resolved registry record after presets, patches and overrides.

func Definitions

func Definitions(role string) []Result

Definitions returns the embedded records for the owner console.

func Playback

func Playback(id Identity, overrides []core.ClientCapabilityOverride) Result

Playback is the codec and limit set for a client that did not send its own profile, plus hardware patches and matching owner overrides. policyID is the policy record for the same client so a device override edits both layers.

func Policy

func Policy(id Identity, overrides []core.ClientCapabilityOverride) Result

Policy is the family, subtitle set and Dolby Vision profiles for id, with matching owner overrides applied.

Jump to

Keyboard shortcuts

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