app

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

This file is autogenerated by Golem Do NOT make modifications, they will be lost

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Background

func Background(m Medium) string

func Cover

func Cover(m Medium) string

func DownloadsCreate

func DownloadsCreate(c *gin.Context)

func DownloadsDelete

func DownloadsDelete(c *gin.Context, id string)

func DownloadsIndex

func DownloadsIndex(c *gin.Context)

func DownloadsShow

func DownloadsShow(c *gin.Context, id string)

func DownloadsUpdate

func DownloadsUpdate(c *gin.Context, id string)

func EpisodesUpdate

func EpisodesUpdate(c *gin.Context, id string)

func Index

func Index(c *gin.Context)

func MoviesCreate

func MoviesCreate(c *gin.Context)

func MoviesDelete

func MoviesDelete(c *gin.Context, id string)

func MoviesIndex

func MoviesIndex(c *gin.Context)

func MoviesShow

func MoviesShow(c *gin.Context, id string)

func MoviesUpdate

func MoviesUpdate(c *gin.Context, id string)

func ReleasesCreate

func ReleasesCreate(c *gin.Context)

func ReleasesDelete

func ReleasesDelete(c *gin.Context, id string)

func ReleasesIndex

func ReleasesIndex(c *gin.Context)

func ReleasesShow

func ReleasesShow(c *gin.Context, id string)

func ReleasesUpdate

func ReleasesUpdate(c *gin.Context, id string)

func SeriesCreate

func SeriesCreate(c *gin.Context)

func SeriesDelete

func SeriesDelete(c *gin.Context, id string)

func SeriesIndex

func SeriesIndex(c *gin.Context)

func SeriesSeasonEpisodes

func SeriesSeasonEpisodes(c *gin.Context, id string, season string)

func SeriesSeasons

func SeriesSeasons(c *gin.Context, id string)

func SeriesShow

func SeriesShow(c *gin.Context, id string)

func SeriesUpdate

func SeriesUpdate(c *gin.Context, id string)

func UpcomingIndex

func UpcomingIndex(c *gin.Context)

Types

type Application

type Application struct {
	Config *Config
	Router *gin.Engine
	DB     *Connector
	Cache  *Cache
	Log    *logrus.Entry
}

func App

func App() *Application

type Cache

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

func NewCache

func NewCache(options redis.Options) (*Cache, error)

func (*Cache) Close

func (c *Cache) Close() error

func (*Cache) Delete

func (c *Cache) Delete(k string) error

func (*Cache) Fetch

func (c *Cache) Fetch(k string, v interface{}, f func() (interface{}, error)) (bool, error)

func (*Cache) Get

func (c *Cache) Get(k string, v interface{}) (bool, error)

func (*Cache) Set

func (c *Cache) Set(k string, v interface{}) error

type Config

type Config struct {
	Mode        string                 `yaml:"mode"`
	Port        int                    `yaml:"port"`
	Connections map[string]*Connection `yaml:"connections"`
	Cron        bool                   `yaml:"cron"`
	Redis       struct {
		Address string `yaml:"address"`
	} `yaml:"redis"`
	Filesystems struct {
		Enabled     bool     `yaml:"enabled"`
		Directories []string `yaml:"directories"`
	} `yaml:"filesystems"`
}

func ConfigInstance

func ConfigInstance() *Config

func (*Config) Validate

func (c *Config) Validate() error

type Connection

type Connection struct {
	URI        string `yaml:"uri,omitempty"`
	Database   string `yaml:"database,omitempty"`
	Collection string `yaml:"collection,omitempty"`
}

type Connector

type Connector struct {
	Download *grimoire.Store[*Download]
	Episode  *grimoire.Store[*Episode]
	Medium   *grimoire.Store[*Medium]
	Release  *grimoire.Store[*Release]
	Series   *grimoire.Store[*Series]
	Watch    *grimoire.Store[*Watch]
}

func NewConnector

func NewConnector() (*Connector, error)

func (*Connector) ActiveDownloads

func (c *Connector) ActiveDownloads() ([]*Download, error)

func (*Connector) EpisodeSetting

func (c *Connector) EpisodeSetting(id, setting string, value bool) error

func (*Connector) SeriesActive

func (c *Connector) SeriesActive() ([]*Series, error)

func (*Connector) SeriesAll

func (c *Connector) SeriesAll() ([]*Series, error)

func (*Connector) SeriesAllUnwatched

func (c *Connector) SeriesAllUnwatched(s *Series) (int, error)

func (*Connector) SeriesSeasonEpisodes

func (c *Connector) SeriesSeasonEpisodes(id string, season string) ([]*Episode, error)

func (*Connector) SeriesSeasons

func (c *Connector) SeriesSeasons(id string) ([]string, error)

func (*Connector) SeriesSetting

func (c *Connector) SeriesSetting(id, setting string, value bool) error

func (*Connector) Upcoming

func (c *Connector) Upcoming() ([]*Episode, error)

type Download

type Download struct {
	grimoire.Document `bson:",inline"` // includes default model settings
	//ID        primitive.ObjectID `json:"_id" bson:"_id,omitempty"`
	//CreatedAt time.Time          `json:"created_at" bson:"created_at"`
	//UpdatedAt time.Time          `json:"updated_at" bson:"updated_at"`
	MediumId   primitive.ObjectID `json:"medium_id" bson:"medium_id"`
	Medium     Medium             `json:"medium" bson:"medium"`
	Auto       bool               `json:"auto" bson:"auto"`
	Multi      bool               `json:"multi" bson:"multi"`
	Force      bool               `json:"force" bson:"force"`
	Url        string             `json:"url" bson:"url"`
	ReleaseId  string             `json:"release_id" bson:"tdo_id"`
	Thash      string             `json:"thash" bson:"thash"`
	Timestamps struct {
		Found      time.Time `json:"found" bson:"found"`
		Loaded     time.Time `json:"loaded" bson:"loaded"`
		Downloaded time.Time `json:"downloaded" bson:"downloaded"`
		Completed  time.Time `json:"completed" bson:"completed"`
		Deleted    time.Time `json:"deleted" bson:"deleted"`
	} `json:"timestamps" bson:"timestamps"`
	Selected string `json:"selected" bson:"selected"`
	Status   string `json:"status" bson:"status"`
	Files    []struct {
		Id       primitive.ObjectID `json:"id" bson:"_id"`
		MediumId primitive.ObjectID `json:"medium_id" bson:"medium_id"`
		Num      int                `json:"num" bson:"num"`
	} `json:"download_files" bson:"download_files"`
}

func NewDownload

func NewDownload() *Download

type Episode

type Episode struct {
	grimoire.Document `bson:",inline"` // includes default model settings
	//ID        primitive.ObjectID `json:"_id" bson:"_id,omitempty"`
	//CreatedAt time.Time          `json:"created_at" bson:"created_at"`
	//UpdatedAt time.Time          `json:"updated_at" bson:"updated_at"`
	Type           string             `json:"type" bson:"_type"`
	SeriesId       primitive.ObjectID `json:"series_id" bson:"series_id"`
	Kind           primitive.Symbol   `json:"kind" bson:"kind"`
	Source         string             `json:"source" bson:"source"`
	SourceId       string             `json:"source_id" bson:"source_id"`
	Title          string             `json:"title" bson:"title"`
	Description    string             `json:"description" bson:"description"`
	Slug           string             `json:"slug" bson:"slug"`
	Text           []string           `json:"text" bson:"text"`
	Display        string             `json:"display" bson:"display"`
	Directory      string             `json:"directory" bson:"directory"`
	Search         string             `json:"search" bson:"search"`
	SeasonNumber   int                `json:"season_number" bson:"season_number"`
	EpisodeNumber  int                `json:"episode_number" bson:"episode_number"`
	AbsoluteNumber int                `json:"absolute_number" bson:"absolute_number"`
	SearchParams   struct {
		Type       string `json:"type" bson:"type"`
		Verified   bool   `json:"verified" bson:"verified"`
		Group      string `json:"group" bson:"group"`
		Author     string `json:"author" bson:"author"`
		Resolution int    `json:"resolution" bson:"resolution"`
		Source     string `json:"source" bson:"source"`
		Uncensored bool   `json:"uncensored" bson:"uncensored"`
		Bluray     bool   `json:"bluray" bson:"bluray"`
	} `json:"search_params" bson:"search_params"`
	Active      bool      `json:"active" bson:"active"`
	Downloaded  bool      `json:"downloaded" bson:"downloaded"`
	Completed   bool      `json:"completed" bson:"completed"`
	Skipped     bool      `json:"skipped" bson:"skipped"`
	Watched     bool      `json:"watched" bson:"watched"`
	Broken      bool      `json:"broken" bson:"broken"`
	ReleaseDate time.Time `json:"release_date" bson:"release_date"`
	Paths       []struct {
		Id        primitive.ObjectID `json:"id" bson:"_id"`
		Type      primitive.Symbol   `json:"type" bson:"type"`
		Remote    string             `json:"remote" bson:"remote"`
		Local     string             `json:"local" bson:"local"`
		Extension string             `json:"extension" bson:"extension"`
		Size      int                `json:"size" bson:"size"`
		UpdatedAt time.Time          `json:"updated_at" bson:"updated_at"`
	} `json:"paths" bson:"paths"`
	Cover      string `json:"cover" bson:"cover"`
	Background string `json:"background" bson:"background"`
}

func NewEpisode

func NewEpisode() *Episode

type Medium

type Medium struct {
	grimoire.Document `bson:",inline"` // includes default model settings
	//ID        primitive.ObjectID `json:"_id" bson:"_id,omitempty"`
	//CreatedAt time.Time          `json:"created_at" bson:"created_at"`
	//UpdatedAt time.Time          `json:"updated_at" bson:"updated_at"`
	Type         string           `json:"type" bson:"_type"`
	Kind         primitive.Symbol `json:"kind" bson:"kind"`
	Source       string           `json:"source" bson:"source"`
	SourceId     string           `json:"source_id" bson:"source_id"`
	Title        string           `json:"title" bson:"title"`
	Description  string           `json:"description" bson:"description"`
	Slug         string           `json:"slug" bson:"slug"`
	Text         []string         `json:"text" bson:"text"`
	Display      string           `json:"display" bson:"display"`
	Directory    string           `json:"directory" bson:"directory"`
	Search       string           `json:"search" bson:"search"`
	SearchParams struct {
		Type       string `json:"type" bson:"type"`
		Verified   bool   `json:"verified" bson:"verified"`
		Group      string `json:"group" bson:"group"`
		Author     string `json:"author" bson:"author"`
		Resolution int    `json:"resolution" bson:"resolution"`
		Source     string `json:"source" bson:"source"`
		Uncensored bool   `json:"uncensored" bson:"uncensored"`
		Bluray     bool   `json:"bluray" bson:"bluray"`
	} `json:"search_params" bson:"search_params"`
	Active      bool      `json:"active" bson:"active"`
	Downloaded  bool      `json:"downloaded" bson:"downloaded"`
	Completed   bool      `json:"completed" bson:"completed"`
	Skipped     bool      `json:"skipped" bson:"skipped"`
	Watched     bool      `json:"watched" bson:"watched"`
	Broken      bool      `json:"broken" bson:"broken"`
	Favorite    bool      `json:"favorite" bson:"favorite"`
	ReleaseDate time.Time `json:"release_date" bson:"release_date"`
	Paths       []struct {
		Id        primitive.ObjectID `json:"id" bson:"_id"`
		Type      primitive.Symbol   `json:"type" bson:"type"`
		Remote    string             `json:"remote" bson:"remote"`
		Local     string             `json:"local" bson:"local"`
		Extension string             `json:"extension" bson:"extension"`
		Size      int                `json:"size" bson:"size"`
		UpdatedAt time.Time          `json:"updated_at" bson:"updated_at"`
	} `json:"paths" bson:"paths"`
	Cover         string             `json:"cover" bson:"cover"`
	Background    string             `json:"background" bson:"background"`
	SeriesId      primitive.ObjectID `json:"series_id" bson:"series_id"`
	SeasonNumber  int                `json:"season_number" bson:"season_number"`
	EpisodeNumber int                `json:"episode_number" bson:"episode_number"`
}

func NewMedium

func NewMedium() *Medium

type Release

type Release struct {
	grimoire.Document `bson:",inline"` // includes default model settings
	//ID        primitive.ObjectID `json:"_id" bson:"_id,omitempty"`
	//CreatedAt time.Time          `json:"created_at" bson:"created_at"`
	//UpdatedAt time.Time          `json:"updated_at" bson:"updated_at"`
	Type        string    `json:"type" bson:"type"`
	Source      string    `json:"source" bson:"source"`
	Raw         string    `json:"raw" bson:"raw"`
	Title       string    `json:"title" bson:"title"`
	Description string    `json:"description" bson:"description"`
	Size        string    `json:"size" bson:"size"`
	View        string    `json:"view" bson:"view"`
	Download    string    `json:"download" bson:"download"`
	Infohash    string    `json:"infohash" bson:"infohash"`
	Name        string    `json:"name" bson:"name"`
	Season      int       `json:"season" bson:"season"`
	Episode     int       `json:"episode" bson:"episode"`
	Volume      int       `json:"volume" bson:"volume"`
	Checksum    string    `json:"checksum" bson:"checksum"`
	Group       string    `json:"group" bson:"group"`
	Author      string    `json:"author" bson:"author"`
	Verified    bool      `json:"verified" bson:"verified"`
	Widescreen  bool      `json:"widescreen" bson:"widescreen"`
	Uncensored  bool      `json:"uncensored" bson:"uncensored"`
	Bluray      bool      `json:"bluray" bson:"bluray"`
	Resolution  string    `json:"resolution" bson:"resolution"`
	Encoding    string    `json:"encoding" bson:"encoding"`
	Quality     string    `json:"quality" bson:"quality"`
	Published   time.Time `json:"published" bson:"published_at"`
}

func NewRelease

func NewRelease() *Release

type Series

type Series struct {
	grimoire.Document `bson:",inline"` // includes default model settings
	//ID        primitive.ObjectID `json:"_id" bson:"_id,omitempty"`
	//CreatedAt time.Time          `json:"created_at" bson:"created_at"`
	//UpdatedAt time.Time          `json:"updated_at" bson:"updated_at"`
	Type         string           `json:"type" bson:"_type"`
	Kind         primitive.Symbol `json:"kind" bson:"kind"`
	Source       string           `json:"source" bson:"source"`
	SourceId     string           `json:"source_id" bson:"source_id"`
	Title        string           `json:"title" bson:"title"`
	Description  string           `json:"description" bson:"description"`
	Slug         string           `json:"slug" bson:"slug"`
	Text         []string         `json:"text" bson:"text"`
	Display      string           `json:"display" bson:"display"`
	Directory    string           `json:"directory" bson:"directory"`
	Search       string           `json:"search" bson:"search"`
	SearchParams struct {
		Type       string `json:"type" bson:"type"`
		Verified   bool   `json:"verified" bson:"verified"`
		Group      string `json:"group" bson:"group"`
		Author     string `json:"author" bson:"author"`
		Resolution int    `json:"resolution" bson:"resolution"`
		Source     string `json:"source" bson:"source"`
		Uncensored bool   `json:"uncensored" bson:"uncensored"`
		Bluray     bool   `json:"bluray" bson:"bluray"`
	} `json:"search_params" bson:"search_params"`
	Active      bool      `json:"active" bson:"active"`
	Downloaded  bool      `json:"downloaded" bson:"downloaded"`
	Completed   bool      `json:"completed" bson:"completed"`
	Skipped     bool      `json:"skipped" bson:"skipped"`
	Watched     bool      `json:"watched" bson:"watched"`
	Broken      bool      `json:"broken" bson:"broken"`
	Favorite    bool      `json:"favorite" bson:"favorite"`
	ReleaseDate time.Time `json:"release_date" bson:"release_date"`
	Paths       []struct {
		Id        primitive.ObjectID `json:"id" bson:"_id"`
		Type      primitive.Symbol   `json:"type" bson:"type"`
		Remote    string             `json:"remote" bson:"remote"`
		Local     string             `json:"local" bson:"local"`
		Extension string             `json:"extension" bson:"extension"`
		Size      int                `json:"size" bson:"size"`
		UpdatedAt time.Time          `json:"updated_at" bson:"updated_at"`
	} `json:"paths" bson:"paths"`
	Cover      string `json:"cover" bson:"cover"`
	Background string `json:"background" bson:"background"`
}

func NewSeries

func NewSeries() *Series

type Server

type Server struct {
	Router *gin.Engine
	Log    *logrus.Entry
	// contains filtered or unexported fields
}

func New

func New() (*Server, error)

func (*Server) Cron

func (s *Server) Cron() error

func (*Server) DownloadsProcess

func (s *Server) DownloadsProcess()

func (*Server) Routes

func (s *Server) Routes()

func (*Server) Start

func (s *Server) Start() error

func (*Server) Watcher

func (s *Server) Watcher()

type Setting

type Setting struct {
	Setting string
	Value   bool
}

type Watch

type Watch struct {
	grimoire.Document `bson:",inline"` // includes default model settings
	//ID        primitive.ObjectID `json:"_id" bson:"_id,omitempty"`
	//CreatedAt time.Time          `json:"created_at" bson:"created_at"`
	//UpdatedAt time.Time          `json:"updated_at" bson:"updated_at"`
	Username  string             `json:"username" bson:"username"`
	Player    string             `json:"player" bson:"player"`
	WatchedAt time.Time          `json:"watched_at" bson:"watched_at"`
	MediumId  primitive.ObjectID `json:"medium_id" bson:"medium_id"`
}

func NewWatch

func NewWatch() *Watch

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳