Documentation
¶
Overview ¶
Package api names the wire types handlers still import. The definitions live with the noun they describe.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Flag ¶ added in v0.3.0
Flag reads an optional request flag, treating an absent one as false.
Parameters:
- value: Submitted flag, nil when the request omitted the field.
Returns:
- flag: The value the flag carries, false when it was absent.
func FlagOrDefault ¶ added in v0.3.0
FlagOrDefault reads an optional request flag against a configured default.
Parameters:
- value: Submitted flag, nil when the request omitted the field.
- fallback: Configured value to use when the field was absent.
Returns:
- flag: The value the flag carries, otherwise fallback.
Types ¶
type ClipRequest ¶
ClipRequest is the export request. The value is a clip.Request.
type ClipResponse ¶
ClipResponse is the clip payload. The value is a clip.Response.
type ErrorCode ¶ added in v0.3.0
type ErrorCode string
ErrorCode is the machine-readable code an ErrorResponse carries.
const ( // InvalidRequest reports a request that could not be read or bound. InvalidRequest ErrorCode = "invalid_request" // NotFound reports a resource nothing is registered under. NotFound ErrorCode = "not_found" // PersistFailed reports something that could not be saved. PersistFailed ErrorCode = "persist_failed" // JobActive reports a clip already queued or rendering. JobActive ErrorCode = "job_active" // MediaPathUnresolved reports a source that could not be resolved. MediaPathUnresolved ErrorCode = "media_path" // InvalidQuality reports a profile id that names no profile. InvalidQuality ErrorCode = "invalid_quality" // InvalidClipType reports a clip type the job cannot become. InvalidClipType ErrorCode = "invalid_clip_type" // NotCancellable reports a clip that is not queued or rendering. NotCancellable ErrorCode = "not_cancellable" // DeleteFailed reports a clip that could not be removed. DeleteFailed ErrorCode = "delete_failed" // NotReady reports a clip that has not finished rendering. NotReady ErrorCode = "not_ready" // FileMissing reports a finished clip whose output is gone. FileMissing ErrorCode = "file_missing" // PreviewBusy reports a preview refused because every slot is taken. PreviewBusy ErrorCode = "preview_busy" // PreviewNotRunning reports a preview that was not rendering. PreviewNotRunning ErrorCode = "preview_not_running" // MissingQuery reports a Plex search carried no query. MissingQuery ErrorCode = "missing_query" // SearchFailed reports a Plex search that could not be completed. SearchFailed ErrorCode = "search_failed" // HTTPError reports a request that failed outside a handler's own codes. HTTPError ErrorCode = "http_error" // PINFailed reports a Plex PIN that could not be created. PINFailed ErrorCode = "pin_failed" // LogoutFailed reports credentials that could not be cleared. LogoutFailed ErrorCode = "logout_failed" )
The codes an ErrorResponse may carry.
type ErrorResponse ¶
ErrorResponse represents an error response.
type MediaItemResponse ¶
type MediaItemResponse struct {
ID string `json:"id"`
Title string `json:"title"`
Type string `json:"type"`
Duration float64 `json:"duration,omitempty"`
ThumbPath string `json:"thumbPath,omitempty"`
LibraryTitle string `json:"libraryTitle,omitempty"`
Year int `json:"year,omitempty"`
Season int `json:"season,omitempty"`
Episode int `json:"episode,omitempty"`
ShowTitle string `json:"showTitle,omitempty"`
}
MediaItemResponse represents a media item in API responses.
type MediaListResponse ¶
type MediaListResponse struct {
Items []MediaItemResponse `json:"items"`
Total int `json:"total"`
}
MediaListResponse represents a paginated list of media items.