Documentation
¶
Index ¶
- Constants
- func Clients() map[string]Client
- func Compare(a, b conform.Response) conform.Report
- func QueryPairs(raw string) [][2]string
- type Client
- type DecisionCorpus
- type DecisionRecord
- type DecisionRequest
- type DiscoveredIDs
- type Protocol
- func (Protocol) Clients() map[string]conform.Client
- func (Protocol) Compare(a, b conform.Response) conform.Report
- func (Protocol) Corpus(string) []conform.Request
- func (Protocol) Discover(ctx context.Context, c *http.Client, base, token, profile string, ...) conform.DiscoveredIDs
- func (Protocol) Fetch(ctx context.Context, c *http.Client, base, token string, r conform.Request, ...) (conform.Response, error)
- func (Protocol) FixtureName(profile string, r conform.Request, jsonMode bool) string
- func (Protocol) Formats() []bool
- func (Protocol) IgnorePaths() []string
- func (Protocol) Redact(r conform.Response) conform.Response
- type Request
- type Response
Constants ¶
const DecisionPath = "/video/:/transcode/universal/decision"
DecisionPath is the Plex media-decision endpoint official clients call.
Variables ¶
This section is empty.
Functions ¶
func Clients ¶
Clients returns representative Plex Web, iOS and Apple TV request profiles, with the X-Plex-Platform values the real apps send (PMS picks its client profile from them and answers 400 to a decision request from an unknown platform such as "iPhone").
func Compare ¶
Compare preserves the Plex-specific response header contract and promotes load-bearing value mismatches (including hub #order) to blocking. Shared Compare leaves KindValue informational so other dialects are not gated on this list.
func QueryPairs ¶
QueryPairs parses a raw query string without reordering.
Types ¶
type DecisionCorpus ¶
type DecisionCorpus struct {
Version int `json:"version"`
Policy string `json:"policy"`
Records []DecisionRecord `json:"records"`
}
DecisionCorpus is the offline oracle of official-client decision requests. Query pairs keep wire order. Header pairs keep the recorded client order. Tokens and hosts are redacted before check-in.
func LoadDecisionCorpus ¶
func LoadDecisionCorpus(path string) (DecisionCorpus, error)
LoadDecisionCorpus reads a redacted decision corpus.
func SeedDecisionCorpus ¶
func SeedDecisionCorpus() DecisionCorpus
SeedDecisionCorpus builds the first corpus from the browsing decision probes. Official-client captures replace these headers/query extras.
type DecisionRecord ¶
type DecisionRecord struct {
ID string `json:"id"`
Client string `json:"client"`
Format string `json:"format"`
Source string `json:"source"`
Request DecisionRequest `json:"request"`
}
DecisionRecord is one redacted decision request plus the fixture it asserts.
func (DecisionRecord) FixturePath ¶
func (r DecisionRecord) FixturePath(root string) string
FixturePath is the recorded PMS response for this decision.
type DecisionRequest ¶
type DecisionRequest struct {
Method string `json:"method"`
Path string `json:"path"`
Query [][2]string `json:"query"`
Headers [][2]string `json:"headers"`
// Raw is the path+query as recorded on the wire (or the browsing
// corpus template). Fixture names and Ether replay use this so
// encoding of {{tokens}} stays byte-identical to the recording.
Raw string `json:"raw,omitempty"`
}
DecisionRequest is the exact decision the client issued.
func (DecisionRequest) HeaderMap ¶
func (r DecisionRequest) HeaderMap() map[string]string
HeaderMap is the request header set, last value wins for a name.
func (DecisionRequest) Target ¶
func (r DecisionRequest) Target() string
Target is the path+query to replay. Raw wins so fixture names stay stable.
type DiscoveredIDs ¶
type DiscoveredIDs = conform.DiscoveredIDs
func Discover ¶
func Discover(ctx context.Context, client *http.Client, base, token, profile string, align *DiscoveredIDs) DiscoveredIDs
Discover reads sections and representative items on one server. If align is non-nil, matching item GUIDs from that server are preferred; absent matches use the first item.
type Protocol ¶
type Protocol struct{}
Protocol implements the Plex conformance dialect.
func (Protocol) Discover ¶
func (Protocol) Discover(ctx context.Context, c *http.Client, base, token, profile string, align *conform.DiscoveredIDs) conform.DiscoveredIDs
func (Protocol) FixtureName ¶
func (Protocol) IgnorePaths ¶
type Request ¶
func Corpus ¶
func Corpus() []Request
Corpus returns probes used when a Plex application connects and browses a server.
func PlaybackCorpus ¶
func PlaybackCorpus() []Request
PlaybackCorpus is deliberately separate from the read-only browsing corpus: recording it changes queues and watch state and starts an encoder. Callers must use a disposable reference library and supply queueID/session variables. Tests run these probes offline with deterministic fake playback.