Documentation ¶
Overview ¶
Package server Takeout API
This is the service API for the Takeout media server.
Terms Of Service:
TOS is TBD ¶
Schemes: https Host: yourhost.com BasePath: /api Version: 0.0.1 License: AGPLv3 https://www.gnu.org/licenses/agpl-3.0.en.html Contact: defsub@defsub.com SecurityDefinitions:
Cookie: type: apiKey name: Cookie description: send Cookie Takeout={token} in: header Bearer: type: apiKey name: Authorization description: send Authorization Bearer {token} scheme: bearer in: header
Security:
- Bearer:
- Cookie:
Consumes: - application/json Produces: - application/json
swagger:meta
Index ¶
- Constants
- Variables
- func Job(config *config.Config, name string) error
- func Serve(config *config.Config) error
- type ArtistResponse
- type ArtistsResponse
- type Context
- type EpisodeResponse
- type GenreResponse
- type HomeResponse
- type IndexResponse
- type KeywordResponse
- type LoginParam
- type Media
- type MovieResponse
- type MoviesResponse
- type OffsetResponse
- type PlaylistResponse
- type PodcastsResponse
- type PopularResponse
- type ProfileResponse
- type ProgressParameter
- type ProgressResponse
- type RadioResponse
- type ReleaseResponse
- type RequestContext
- func (ctx RequestContext) Activity() *activity.Activity
- func (ctx RequestContext) ArtistBackground(a music.Artist) string
- func (ctx RequestContext) ArtistImage(a music.Artist) string
- func (ctx RequestContext) Auth() *auth.Auth
- func (ctx RequestContext) Config() *config.Config
- func (ctx RequestContext) EpisodeImage(e podcast.Episode) string
- func (ctx RequestContext) FindArtist(id string) (music.Artist, error)
- func (ctx RequestContext) FindEpisode(id string) (podcast.Episode, error)
- func (ctx RequestContext) FindMovie(id string) (video.Movie, error)
- func (ctx RequestContext) FindRelease(id string) (music.Release, error)
- func (ctx RequestContext) FindSeries(id string) (podcast.Series, error)
- func (ctx RequestContext) FindStation(id string) (music.Station, error)
- func (ctx RequestContext) FindTrack(id string) (music.Track, error)
- func (ctx RequestContext) ImageClient() *client.Client
- func (RequestContext) LocateEpisode(e podcast.Episode) string
- func (RequestContext) LocateMovie(v video.Movie) string
- func (RequestContext) LocateTrack(t music.Track) string
- func (ctx RequestContext) MovieImage(m video.Movie) string
- func (ctx RequestContext) Music() *music.Music
- func (ctx RequestContext) Podcast() *podcast.Podcast
- func (ctx RequestContext) Progress() *progress.Progress
- func (ctx RequestContext) Session() *auth.Session
- func (ctx RequestContext) Template() *template.Template
- func (ctx RequestContext) TrackImage(t music.Track) string
- func (ctx RequestContext) User() *auth.User
- func (ctx RequestContext) Video() *video.Video
- type SearchResponse
- type SeriesResponse
- type SinglesResponse
- type StatusResponse
Constants ¶
const ( ApplicationJson = "application/json" ParamID = ":id" ParamRes = ":res" ParamName = ":name" ParamEID = ":eid" ParamUUID = ":uuid" )
const ( AllowCookie bits = 1 << iota AllowAccessToken AllowMediaToken AuthorizationHeader = "Authorization" BearerAuthorization = "Bearer" )
const ( IntentAuth = "TAKEOUT_AUTH" IntentPlay = "TAKEOUT_PLAY" IntentNew = "TAKEOUT_NEW" UserParamCookie = "cookie" )
const ( CoverArtArchivePrefix = "http://coverartarchive.org" TMDBPrefix = "https://image.tmdb.org" FanArtPrefix = "https://assets.fanart.tv/fanart" )
const ( SuccessRedirect = "/" LinkRedirect = "/static/link.html" LoginRedirect = "/static/login.html" )
Variables ¶
var ( HeaderContentType = http.CanonicalHeaderKey("Content-Type") HeaderContentLength = http.CanonicalHeaderKey("Content-Length") HeaderLastModified = http.CanonicalHeaderKey("Last-Modified") HeaderCacheControl = http.CanonicalHeaderKey("Cache-Control") HeaderETag = http.CanonicalHeaderKey("ETag") )
var ( ErrNoMedia = errors.New("media not available") ErrInvalidMethod = errors.New("invalid request method") ErrInvalidCode = errors.New("invalid code") ErrNotFound = errors.New("not found") ErrInvalidOffset = errors.New("invalid offset") ErrAccessDenied = errors.New("access denied") ErrMissingToken = errors.New("missing token") ErrMissingAccessToken = errors.New("missing access token") ErrMissingMediaToken = errors.New("missing media token") ErrInvalidSession = errors.New("invalid session") )
Functions ¶
Types ¶
type ArtistResponse ¶
swagger:response
type ArtistsResponse ¶
swagger:response
type Context ¶
type Context interface { Activity() *activity.Activity Auth() *auth.Auth Config() *config.Config Music() *music.Music Podcast() *podcast.Podcast Progress() *progress.Progress Template() *template.Template User() *auth.User Session() *auth.Session Video() *video.Video ImageClient() *client.Client LocateTrack(music.Track) string LocateMovie(video.Movie) string LocateEpisode(podcast.Episode) string FindArtist(string) (music.Artist, error) FindRelease(string) (music.Release, error) FindTrack(string) (music.Track, error) FindStation(string) (music.Station, error) FindMovie(string) (video.Movie, error) FindSeries(string) (podcast.Series, error) FindEpisode(string) (podcast.Episode, error) TrackImage(music.Track) string ArtistImage(music.Artist) string ArtistBackground(music.Artist) string MovieImage(video.Movie) string EpisodeImage(podcast.Episode) string }
type EpisodeResponse ¶
swagger:response
type GenreResponse ¶
swagger:response
type HomeResponse ¶
swagger:response
type IndexResponse ¶
swagger:response
type KeywordResponse ¶
swagger:response
type LoginParam ¶
type LoginParam struct { // in: body Body struct { // contains filtered or unexported fields } }
swagger:parameters Login
type MovieResponse ¶
swagger:response
type MoviesResponse ¶
swagger:response
type OffsetResponse ¶
swagger:response
type PlaylistResponse ¶
swagger:response
type PodcastsResponse ¶
swagger:response
type PopularResponse ¶
swagger:response
type ProfileResponse ¶
swagger:response
type ProgressParameter ¶
swagger:parameters ProgressUpdate
type ProgressResponse ¶
swagger:response
type RadioResponse ¶
swagger:response
type ReleaseResponse ¶
swagger:response
type RequestContext ¶
type RequestContext struct {
// contains filtered or unexported fields
}
func (RequestContext) Activity ¶
func (ctx RequestContext) Activity() *activity.Activity
func (RequestContext) ArtistBackground ¶
func (ctx RequestContext) ArtistBackground(a music.Artist) string
func (RequestContext) ArtistImage ¶
func (ctx RequestContext) ArtistImage(a music.Artist) string
func (RequestContext) Auth ¶
func (ctx RequestContext) Auth() *auth.Auth
func (RequestContext) Config ¶
func (ctx RequestContext) Config() *config.Config
func (RequestContext) EpisodeImage ¶
func (ctx RequestContext) EpisodeImage(e podcast.Episode) string
func (RequestContext) FindArtist ¶
func (ctx RequestContext) FindArtist(id string) (music.Artist, error)
func (RequestContext) FindEpisode ¶
func (ctx RequestContext) FindEpisode(id string) (podcast.Episode, error)
func (RequestContext) FindMovie ¶
func (ctx RequestContext) FindMovie(id string) (video.Movie, error)
func (RequestContext) FindRelease ¶
func (ctx RequestContext) FindRelease(id string) (music.Release, error)
func (RequestContext) FindSeries ¶
func (ctx RequestContext) FindSeries(id string) (podcast.Series, error)
func (RequestContext) FindStation ¶
func (ctx RequestContext) FindStation(id string) (music.Station, error)
func (RequestContext) FindTrack ¶
func (ctx RequestContext) FindTrack(id string) (music.Track, error)
func (RequestContext) ImageClient ¶
func (ctx RequestContext) ImageClient() *client.Client
func (RequestContext) LocateEpisode ¶
func (RequestContext) LocateEpisode(e podcast.Episode) string
func (RequestContext) LocateMovie ¶
func (RequestContext) LocateMovie(v video.Movie) string
func (RequestContext) LocateTrack ¶
func (RequestContext) LocateTrack(t music.Track) string
func (RequestContext) MovieImage ¶
func (ctx RequestContext) MovieImage(m video.Movie) string
func (RequestContext) Music ¶
func (ctx RequestContext) Music() *music.Music
func (RequestContext) Podcast ¶
func (ctx RequestContext) Podcast() *podcast.Podcast
func (RequestContext) Progress ¶
func (ctx RequestContext) Progress() *progress.Progress
func (RequestContext) Session ¶
func (ctx RequestContext) Session() *auth.Session
func (RequestContext) Template ¶
func (ctx RequestContext) Template() *template.Template
func (RequestContext) TrackImage ¶
func (ctx RequestContext) TrackImage(t music.Track) string
func (RequestContext) User ¶
func (ctx RequestContext) User() *auth.User
func (RequestContext) Video ¶
func (ctx RequestContext) Video() *video.Video
type SearchResponse ¶
swagger:response
type SeriesResponse ¶
swagger:response
type SinglesResponse ¶
swagger:response
type StatusResponse ¶
type StatusResponse struct { // in: body Body struct { // contains filtered or unexported fields } }
swagger:response