server

package
v0.0.0-...-5edc56a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2023 License: AGPL-3.0 Imports: 34 Imported by: 0

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

View Source
const (
	ApplicationJson = "application/json"

	ParamID   = ":id"
	ParamRes  = ":res"
	ParamName = ":name"
	ParamEID  = ":eid"
	ParamUUID = ":uuid"
)
View Source
const (
	AllowCookie bits = 1 << iota
	AllowAccessToken
	AllowMediaToken

	AuthorizationHeader = "Authorization"
	BearerAuthorization = "Bearer"
)
View Source
const (
	IntentAuth = "TAKEOUT_AUTH"
	IntentPlay = "TAKEOUT_PLAY"
	IntentNew  = "TAKEOUT_NEW"

	UserParamCookie = "cookie"
)
View Source
const (
	CoverArtArchivePrefix = "http://coverartarchive.org"
	TMDBPrefix            = "https://image.tmdb.org"
	FanArtPrefix          = "https://assets.fanart.tv/fanart"
)
View Source
const (
	SuccessRedirect = "/"
	LinkRedirect    = "/static/link.html"
	LoginRedirect   = "/static/login.html"
)

Variables

View Source
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")
)
View Source
var (
	ErrNoMedia            = errors.New("media not available")
	ErrInvalidMethod      = errors.New("invalid request method")
	ErrUnauthorized       = errors.New("unauthorized")
	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")
	ErrMissingCcookie     = errors.New("missing cookie")
	ErrInvalidSession     = errors.New("invalid session")
)

Functions

func Job

func Job(config *config.Config, name string) error

func Serve

func Serve(config *config.Config) error

Serve configures and starts the Takeout web, websocket, and API services.

Types

type ArtistResponse

type ArtistResponse struct {
	// in: body
	Body struct {
		view.Artist
	}
}

swagger:response

type ArtistsResponse

type ArtistsResponse struct {
	// in: body
	Body struct {
		view.Artists
	}
}

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

type EpisodeResponse struct {
	// in: body
	Body struct {
		view.Episode
	}
}

swagger:response

type GenreResponse

type GenreResponse struct {
	// in: body
	Body struct {
		view.Genre
	}
}

swagger:response

type HomeResponse

type HomeResponse struct {
	// in: body
	Body struct {
		view.Home
	}
}

swagger:response

type IndexResponse

type IndexResponse struct {
	// in: body
	Body struct {
		view.Index
	}
}

swagger:response

type KeywordResponse

type KeywordResponse struct {
	// in: body
	Body struct {
		view.Keyword
	}
}

swagger:response

type LoginParam

type LoginParam struct {
	// in: body
	Body struct {
		// contains filtered or unexported fields
	}
}

swagger:parameters Login

type Media

type Media struct {
	// contains filtered or unexported fields
}

func (Media) Config

func (m Media) Config() *config.Config

func (Media) Music

func (m Media) Music() *music.Music

func (Media) Podcast

func (m Media) Podcast() *podcast.Podcast

func (Media) Video

func (m Media) Video() *video.Video

type MovieResponse

type MovieResponse struct {
	// in: body
	Body struct {
		view.Movie
	}
}

swagger:response

type MoviesResponse

type MoviesResponse struct {
	// in: body
	Body struct {
		view.Movies
	}
}

swagger:response

type OffsetResponse

type OffsetResponse struct {
	// in: body
	Body struct {
		view.Offset
	}
}

swagger:response

type PlaylistResponse

type PlaylistResponse struct {
	// in: body
	Body struct {
		spiff.Playlist
	}
}

swagger:response

type PodcastsResponse

type PodcastsResponse struct {
	// in: body
	Body struct {
		view.Podcasts
	}
}

swagger:response

type PopularResponse

type PopularResponse struct {
	// in: body
	Body struct {
		view.Popular
	}
}

swagger:response

type ProfileResponse

type ProfileResponse struct {
	// in: body
	Body struct {
		view.Profile
	}
}

swagger:response

type ProgressParameter

type ProgressParameter struct {
	// in: body
	Body struct {
		progress.Offsets
	}
}

swagger:parameters ProgressUpdate

type ProgressResponse

type ProgressResponse struct {
	// in: body
	Body struct {
		view.Progress
	}
}

swagger:response

type RadioResponse

type RadioResponse struct {
	// in: body
	Body struct {
		view.Radio
	}
}

swagger:response

type ReleaseResponse

type ReleaseResponse struct {
	// in: body
	Body struct {
		view.Release
	}
}

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

type SearchResponse struct {
	// in: body
	Body struct {
		view.Search
	}
}

swagger:response

type SeriesResponse

type SeriesResponse struct {
	// in: body
	Body struct {
		view.Series
	}
}

swagger:response

type SinglesResponse

type SinglesResponse struct {
	// in: body
	Body struct {
		view.Singles
	}
}

swagger:response

type StatusResponse

type StatusResponse struct {
	// in: body
	Body struct {
		// contains filtered or unexported fields
	}
}

swagger:response

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL