Documentation
¶
Overview ¶
Package plex adapts the shared github.com/cplieger/plexapi client for the exporter. The transport — header-borne token, refuse-all redirects, same-origin path guard, CA pinning, transparent retry with Retry-After honoring, bounded reads — is the library's; this package owns the exporter's construction shape (env-derived CA path, retry counter metric) and re-exports the error types the startup classifier keys on.
Package plex provides the HTTP client used to talk to a Plex Media Server, including retry semantics, the ErrNotFound sentinel, and the HTTPStatusError type used by callers to distinguish 4xx from 5xx responses.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = plexapi.ErrNotFound
ErrNotFound is the library's 404 sentinel, re-exported so call sites and the Plex Pass graceful-degradation path keep reading plex.ErrNotFound.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is the exporter's Plex client: the library client plus the cumulative retry counter surfaced as plex_http_retries_total.
func NewClient ¶
NewClient parses serverURL and returns a Client. When caCertPath is non-empty, the PEM file at that path is pinned as the sole TLS trust anchor (verification stays ON) — the recommended setup for a self-signed Plex. An empty caCertPath uses the OS trust store (right for *.plex.direct and plain http URLs).
func NewClientFromHTTP ¶ added in v2.0.30
NewClientFromHTTP builds a Client over a caller-supplied *http.Client — the test-fixture path (httptest servers). No retry transport or counter is installed; Retries() reports 0.
func (*Client) GetContainerSize ¶
GetContainerSize reports the totalSize of the container at path, used for type-filtered library counts. Kept under its historical name; the implementation is the library's ContainerTotalSize.
type HTTPStatusError ¶
type HTTPStatusError = plexapi.StatusError
HTTPStatusError is the library's non-200 error, aliased so the startup fatal-vs-transient classifier keeps matching with errors.As.