Documentation
¶
Overview ¶
Package sourceadmin provides the private owner source-console protocol. It starts no workers and never accepts provider configuration or target URLs.
Index ¶
Constants ¶
const MaxItems = 100
const Path = "/cluster/runtime/source-admin"
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(o ClientOptions) (*Client, error)
func (*Client) CloseIdleConnections ¶
func (c *Client) CloseIdleConnections()
type ClientOptions ¶
type ClientOptions struct {
Guard *nodewire.Guard
Peer nodewire.Identity
// Endpoint is an explicit origin (https://host:port), never caller input.
Endpoint string
// Authorize checks current exact local server and target source roles and
// current resource eligibility before each dial. Guard additionally checks
// fresh remote incarnation/revocation before any HTTP headers are sent.
Authorize func(context.Context, nodewire.Identity, Request) error
Timeout time.Duration
}
type Diagnostics ¶
type Diagnostics struct {
Providers []Provider `json:"providers"`
Indexers []Indexer `json:"indexers"`
Cache *Cache `json:"cache,omitempty"`
Stream *Stream `json:"stream,omitempty"`
Sources []SourceStartup `json:"sources,omitempty"`
}
type Operation ¶
type Operation string
const ( Snapshot Operation = "snapshot" TestProvider Operation = "test-provider" TestIndexer Operation = "test-indexer" TestDebrid Operation = "test-debrid" Traces Operation = "traces" CacheStatus Operation = "cache-status" ReleaseHistory Operation = "release-history" Variants Operation = "variants" )
type Options ¶
type Options struct {
Guard *nodewire.Guard
Local nodewire.Identity
// Authorize MUST freshly check exact caller boot/node has server role,
// local boot/node has source role, and the operation's source/resource
// remains eligible in current shared config. Unavailable policy denies.
Authorize func(context.Context, nodewire.Identity, nodewire.Identity, Request) error
// VerifyOwner independently checks the ORIGINAL opaque credential with
// real current owner authority. No delegated/viewer/setup bypass is valid.
VerifyOwner func(context.Context, string) error
Services Services
Timeout time.Duration
}
type Query ¶
Query is deliberately not a generic payload: no host, path, headers, config, credential, viewer identity, or arbitrary search terms can cross this boundary.
type Release ¶
type Release struct {
HistoryID int64 `json:"historyID,omitempty"`
TitleID int64 `json:"titleID"`
AtUnixMilli int64 `json:"atUnixMilli,omitempty"`
Size int64 `json:"size"`
Height int `json:"height,omitempty"`
State Status `json:"state"`
Pinned bool `json:"pinned"`
Automatic bool `json:"automatic"`
}
type Response ¶
type Response struct {
Diagnostics *Diagnostics `json:"diagnostics,omitempty"`
Cache *Cache `json:"cache,omitempty"`
Traces []Trace `json:"traces,omitempty"`
Releases []Release `json:"releases,omitempty"`
Tested bool `json:"tested,omitempty"`
}
type Services ¶
type Services struct {
Snapshot func(context.Context, int) (Diagnostics, error)
TestProvider func(context.Context, string) error
TestIndexer func(context.Context, string) error
TestDebrid func(context.Context, string) error
Traces func(context.Context, Query) ([]Trace, error)
CacheStatus func(context.Context, string) (Cache, error)
ReleaseHistory func(context.Context, Query) ([]Release, error)
Variants func(context.Context, Query) ([]Release, error)
}
Services are real, cancellation-aware operations. Test callbacks resolve the ID against CURRENT shared config at invocation, never a cached config snapshot. Nil means unsupported. Callbacks must not substitute successful dummy results.
type SourceStartup ¶
type Status ¶
type Status string
Status and every other textual response field are closed enums. Real service adapters must project existing diagnostics, never copy raw errors/config/logs.
type Trace ¶
type Trace struct {
TitleID int64 `json:"titleID"`
AtUnixMilli int64 `json:"atUnixMilli"`
State Status `json:"state"`
Candidates int `json:"candidates"`
SearchMillis int64 `json:"searchMillis"`
PreparationMillis int64 `json:"preparationMillis"`
TotalMillis int64 `json:"totalMillis"`
Failover bool `json:"failover"`
Pinned bool `json:"pinned"`
}
Trace excludes raw candidate names, URLs, routing descriptions and errors.