Documentation ¶
Index ¶
- Constants
- func NewServer(cookieSecret string, mainHandler *MainHandler, adminHandler *AdminHandler, ...) *gin.Engine
- func RenderHTML(c *gin.Context, code int, name string, obj gin.H)
- type AdminFilmManager
- type AdminHandler
- func (ah AdminHandler) GETAdmin(c *gin.Context)
- func (ah AdminHandler) GETAdminUser(c *gin.Context)
- func (ah AdminHandler) GETAdminVolume(c *gin.Context)
- func (ah AdminHandler) POSTDeleteUser(c *gin.Context)
- func (ah AdminHandler) POSTDeleteVolume(c *gin.Context)
- func (ah AdminHandler) POSTEditFilmOnline(c *gin.Context)
- func (ah AdminHandler) POSTEditUser(c *gin.Context)
- func (ah AdminHandler) POSTEditVolume(c *gin.Context)
- func (ah AdminHandler) POSTReloadCache(c *gin.Context)
- type AdminUserManager
- type AdminVolumeManager
- type FilmHandler
- type FilmManager
- type FilmPaginater
- type FilmPersonManager
- type Filterer
- type MainCacher
- type MainHandler
- func (mh MainHandler) Error404(c *gin.Context)
- func (mh MainHandler) GETCache(c *gin.Context)
- func (mh MainHandler) GETIndex(c *gin.Context)
- func (mh MainHandler) GETLogin(c *gin.Context)
- func (mh MainHandler) GETLogout(c *gin.Context)
- func (mh MainHandler) GETSettings(c *gin.Context)
- func (mh MainHandler) GETStart(c *gin.Context)
- func (mh MainHandler) POSTLogin(c *gin.Context)
- func (mh MainHandler) POSTSetPassword(c *gin.Context)
- func (mh MainHandler) POSTStart(c *gin.Context)
- type MainUserManager
- type OwnerStorer
- type PersonFilmManager
- type PersonHandler
- type PersonManager
- type PersonPaginater
- type RarbgHandler
- type TorrentStorer
Constants ¶
const (
// UserKey is the session key for user data
UserKey = "user"
)
Variables ¶
This section is empty.
Functions ¶
func NewServer ¶
func NewServer(cookieSecret string, mainHandler *MainHandler, adminHandler *AdminHandler, filmHandler *FilmHandler, personHandler *PersonHandler, rarbgHandler *RarbgHandler, db OwnerStorer) *gin.Engine
NewServer initializes the server
Types ¶
type AdminFilmManager ¶
type AdminHandler ¶
type AdminHandler struct { AdminFilmManager AdminUserManager AdminVolumeManager }
func NewAdminHandler ¶
func NewAdminHandler(fm AdminFilmManager, um AdminUserManager, vm AdminVolumeManager) *AdminHandler
func (AdminHandler) GETAdmin ¶
func (ah AdminHandler) GETAdmin(c *gin.Context)
GETAdmin displays the admin page
func (AdminHandler) GETAdminUser ¶
func (ah AdminHandler) GETAdminUser(c *gin.Context)
GETAdminUser displays the user edit page
func (AdminHandler) GETAdminVolume ¶
func (ah AdminHandler) GETAdminVolume(c *gin.Context)
GETAdminVolume displays the volume edit page
func (AdminHandler) POSTDeleteUser ¶
func (ah AdminHandler) POSTDeleteUser(c *gin.Context)
POSTDeleteUser deletes a user from a POST request
func (AdminHandler) POSTDeleteVolume ¶
func (ah AdminHandler) POSTDeleteVolume(c *gin.Context)
POSTDeleteVolume deletes a volume from a POST request
func (AdminHandler) POSTEditFilmOnline ¶
func (ah AdminHandler) POSTEditFilmOnline(c *gin.Context)
POSTEditFilmOnline handle editing a film from online link
func (AdminHandler) POSTEditUser ¶
func (ah AdminHandler) POSTEditUser(c *gin.Context)
POSTEditUser handles editing (and adding) a user from POST request
func (AdminHandler) POSTEditVolume ¶
func (ah AdminHandler) POSTEditVolume(c *gin.Context)
POSTEditVolume handles editing (and adding) a volume from POST request
func (AdminHandler) POSTReloadCache ¶
func (ah AdminHandler) POSTReloadCache(c *gin.Context)
POSTReloadCache reloads the cache
type AdminUserManager ¶
type AdminVolumeManager ¶
type FilmHandler ¶
type FilmHandler struct { FilmManager FilmPersonManager Filterer FilmPaginater[model.Film] // contains filtered or unexported fields }
func NewFilmHandler ¶
func NewFilmHandler(fm FilmManager, fpm FilmPersonManager, f Filterer, fp FilmPaginater[model.Film]) *FilmHandler
func (FilmHandler) GETFilm ¶
func (fh FilmHandler) GETFilm(c *gin.Context)
GETFilm displays information about a film
func (FilmHandler) GETFilmDownload ¶
func (fh FilmHandler) GETFilmDownload(c *gin.Context)
GETFilmDownload downloads a film file
func (FilmHandler) GETFilms ¶
func (fh FilmHandler) GETFilms(c *gin.Context)
GETFilms displays the list of films
func (FilmHandler) GETSubtitleDownload ¶
func (fh FilmHandler) GETSubtitleDownload(c *gin.Context)
GETSubtitleDownload downloads a subtitle file
type FilmManager ¶
type FilmManager interface { GetFilm(filmHexID string) (*model.Film, error) GetFilmPath(filmHexID, filmIndex string) (string, error) GetFilmSubtitlePath(filmHexID, filmIndex, subtitleIndex string) (string, error) GetFilms() []model.Film GetFilmsFiltered(years []int, genre, country, search string) (films []model.Film) }
type FilmPaginater ¶ added in v1.0.3
type FilmPaginater[T model.Film] interface { GetPagination(currentPage int64, items []T) ([]T, []model.Pagination) }
type FilmPersonManager ¶
type MainCacher ¶
type MainHandler ¶
type MainHandler struct { MainCacher MainUserManager }
func NewMainHandler ¶
func NewMainHandler(mc MainCacher, mum MainUserManager) *MainHandler
func (MainHandler) Error404 ¶
func (mh MainHandler) Error404(c *gin.Context)
Error404 displays the 404 page
func (MainHandler) GETCache ¶
func (mh MainHandler) GETCache(c *gin.Context)
GETCache serves the cached file
func (MainHandler) GETIndex ¶
func (mh MainHandler) GETIndex(c *gin.Context)
GETIndex displays the index page
func (MainHandler) GETLogin ¶
func (mh MainHandler) GETLogin(c *gin.Context)
GETLogin displays the registration page
func (MainHandler) GETLogout ¶
func (mh MainHandler) GETLogout(c *gin.Context)
GETLogout logs out the user and redirects to index
func (MainHandler) GETSettings ¶
func (mh MainHandler) GETSettings(c *gin.Context)
GETSettings displays the user settings page
func (MainHandler) GETStart ¶
func (mh MainHandler) GETStart(c *gin.Context)
GetStart allows regsitration of first user (admin & owner)
func (MainHandler) POSTLogin ¶
func (mh MainHandler) POSTLogin(c *gin.Context)
POSTLogin handles login from POST request
func (MainHandler) POSTSetPassword ¶
func (mh MainHandler) POSTSetPassword(c *gin.Context)
POSTSetPassword handles changing password from POST request
func (MainHandler) POSTStart ¶
func (mh MainHandler) POSTStart(c *gin.Context)
POSTStart handles registration (only available for first account)
type MainUserManager ¶
type OwnerStorer ¶
type PersonFilmManager ¶
type PersonHandler ¶
type PersonHandler struct { PersonManager PersonFilmManager PersonPaginater[model.Person] }
func NewPersonHandler ¶
func NewPersonHandler(pm PersonManager, pfm PersonFilmManager, pp PersonPaginater[model.Person]) *PersonHandler
func (PersonHandler) GETActor ¶
func (ph PersonHandler) GETActor(c *gin.Context)
GETActor displays the actor's bio and the films they star in
func (PersonHandler) GETDirector ¶
func (ph PersonHandler) GETDirector(c *gin.Context)
HandleGetDirector displays the directors's bio and the films they directed
func (PersonHandler) GETPeople ¶
func (ph PersonHandler) GETPeople(c *gin.Context)
HandleGETFilms displays the list of people
func (PersonHandler) GETPerson ¶
func (ph PersonHandler) GETPerson(c *gin.Context)
GETPerson displays the actor's bio and the films they star in
func (PersonHandler) GETWriter ¶
func (ph PersonHandler) GETWriter(c *gin.Context)
HandleGetWriter displays the writer's bio and the films they wrote
type PersonManager ¶
type PersonPaginater ¶ added in v1.0.3
type PersonPaginater[T model.Person] interface { GetPagination(currentPage int64, items []T) ([]T, []model.Pagination) }
type RarbgHandler ¶ added in v1.1.0
type RarbgHandler struct { TorrentStorer // contains filtered or unexported fields }
func NewRarbgHandler ¶ added in v1.1.0
func NewRarbgHandler(ts TorrentStorer, torznabAPIKey string) *RarbgHandler
func (RarbgHandler) GETTorrents ¶ added in v1.1.0
func (rh RarbgHandler) GETTorrents(c *gin.Context)
GETTorrents displays the list of torrents
func (RarbgHandler) GETTorznab ¶ added in v1.1.0
func (rh RarbgHandler) GETTorznab(c *gin.Context)
type TorrentStorer ¶ added in v1.1.0
type TorrentStorer interface { SearchTorrents(ctx context.Context, search, category string, page uint) ([]model.RarbgTorrent, error) GetTorrents(ctx context.Context, imdbID string, offset, limit int64) ([]model.RarbgTorrent, error) GetAllTVTorrents(ctx context.Context, offset, limit int64) (torrents []model.RarbgTorrent, err error) GetTVTorrents(ctx context.Context, imdbID, season, episode string, offset, limit int64) (torrents []model.RarbgTorrent, err error) }