Documentation ¶
Overview ¶
Code generated by github.com/dashotv/golem. DO NOT EDIT.
Code generated by github.com/dashotv/golem. DO NOT EDIT.
Code generated by github.com/dashotv/golem. DO NOT EDIT.
Index ¶
- func FileCopy(srcpath, dstpath string) (err error)
- func FileDir(file string) error
- func FileLink(srcpath, dstpath string, force bool) error
- func QueryBool(c echo.Context, name string) bool
- func QueryDefaultInteger(c echo.Context, name string, def int) (int, error)
- func QueryDefaultString(c echo.Context, name, def string) string
- func QueryInt(c echo.Context, name string) int
- func QueryString(c echo.Context, name string) string
- func Setup() error
- func Start() error
- func WithTimeout(delegate func() interface{}, timeout time.Duration) (ret interface{}, ok bool)
- type Application
- func (a *Application) CreateReleasesSearch(c echo.Context) (*search.ReleaseSearch, error)
- func (a *Application) CreateRunicSearch(c echo.Context) (*search.RunicSearch, error)
- func (a *Application) CreateSearch(c echo.Context) (*search.MediaSearch, error)
- func (a *Application) ElasticSearchIndex(payload any) error
- func (a *Application) EsDelete(c echo.Context, index string) error
- func (a *Application) EsDeleteHandler(c echo.Context) error
- func (a *Application) EsIndex(c echo.Context) error
- func (a *Application) EsIndexHandler(c echo.Context) error
- func (a *Application) EsMedia(c echo.Context) error
- func (a *Application) EsMediaHandler(c echo.Context) error
- func (a *Application) EsRelease(c echo.Context) error
- func (a *Application) EsReleaseHandler(c echo.Context) error
- func (a *Application) Health() (map[string]bool, error)
- func (a *Application) MediaIndex(c echo.Context, start, limit int, ...) error
- func (a *Application) MediaIndexHandler(c echo.Context) error
- func (a *Application) NzbsMovie(c echo.Context, imdbid, tmdbid string) error
- func (a *Application) NzbsMovieHandler(c echo.Context) error
- func (a *Application) NzbsTv(c echo.Context, tvdbid string, season, episode int) error
- func (a *Application) NzbsTvHandler(c echo.Context) error
- func (a *Application) ReleasesIndex(c echo.Context, start, limit int, type_, text string, ...) error
- func (a *Application) ReleasesIndexHandler(c echo.Context) error
- func (a *Application) Routes()
- func (a *Application) RunicIndex(c echo.Context, start, limit int, type_, text string, ...) error
- func (a *Application) RunicIndexHandler(c echo.Context) error
- func (a *Application) SearchIndex(c echo.Context, start, limit int, types, q, name string) error
- func (a *Application) SearchIndexHandler(c echo.Context) error
- type Config
- type Connection
- type ConnectionSet
- type Connector
- type ElasticSearchIndexPayload
- type EventEpisodes
- type EventMovies
- type EventSeries
- type Events
- type EventsChannel
- type EventsTopic
- type H
- type Response
- type SearchAllResponse
- type SearchResponse
- type SearchResult
- type Setting
- type SettingsBatch
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileCopy ¶
https://stackoverflow.com/questions/21060945/simple-way-to-copy-a-file Copy copies the contents of the file at srcpath to a regular file at dstpath. If dstpath already exists and is not a directory, the function truncates it. The function does not copy file modes or file attributes.
func FileLink ¶
FileLink creates hard link, if destination exists and force is true, it will remove the destination before linking
func QueryDefaultInteger ¶
QueryDefaultInt retrieves an integer param from the gin request querystring defaults to def argument if not found
func QueryDefaultString ¶
func QueryString ¶
QueryString retrieves a string param from the gin request querystring
func WithTimeout ¶
WithTimeout runs a delegate function with a timeout,
Example: Wait for a channel
if value, ok := WithTimeout(func()interface{}{return <- inbox}, time.Second); ok { // returned } else { // didn't return }
Example: To send to a channel
_, ok := WithTimeout(func()interface{}{outbox <- myValue; return nil}, time.Second) if !ok { // didn't send }
Types ¶
type Application ¶
type Application struct { Config *Config Log *zap.SugaredLogger //golem:template:app/app_partial_definitions // DO NOT EDIT. This section is managed by github.com/dashotv/golem. // Routes Engine *echo.Echo Default *echo.Group Router *echo.Group // Models DB *Connector // Events Events *Events Client *search.Client ES *elasticsearch.Client Nzbgeek *nzbgeek.Client Tmdb *tmdb.Client Tvdb *tvdb.Client }
func (*Application) CreateReleasesSearch ¶
func (a *Application) CreateReleasesSearch(c echo.Context) (*search.ReleaseSearch, error)
func (*Application) CreateRunicSearch ¶
func (a *Application) CreateRunicSearch(c echo.Context) (*search.RunicSearch, error)
func (*Application) CreateSearch ¶
func (a *Application) CreateSearch(c echo.Context) (*search.MediaSearch, error)
func (*Application) ElasticSearchIndex ¶
func (a *Application) ElasticSearchIndex(payload any) error
func (*Application) EsDelete ¶ added in v0.10.5
func (a *Application) EsDelete(c echo.Context, index string) error
func (*Application) EsDeleteHandler ¶ added in v0.10.5
func (a *Application) EsDeleteHandler(c echo.Context) error
func (*Application) EsIndex ¶
func (a *Application) EsIndex(c echo.Context) error
func (*Application) EsIndexHandler ¶
func (a *Application) EsIndexHandler(c echo.Context) error
Es (/es)
func (*Application) EsMedia ¶
func (a *Application) EsMedia(c echo.Context) error
func (*Application) EsMediaHandler ¶
func (a *Application) EsMediaHandler(c echo.Context) error
func (*Application) EsRelease ¶
func (a *Application) EsRelease(c echo.Context) error
func (*Application) EsReleaseHandler ¶
func (a *Application) EsReleaseHandler(c echo.Context) error
func (*Application) MediaIndex ¶
func (*Application) MediaIndexHandler ¶
func (a *Application) MediaIndexHandler(c echo.Context) error
Media (/media)
func (*Application) NzbsMovie ¶
func (a *Application) NzbsMovie(c echo.Context, imdbid, tmdbid string) error
func (*Application) NzbsMovieHandler ¶
func (a *Application) NzbsMovieHandler(c echo.Context) error
Nzbs (/nzbs)
func (*Application) NzbsTv ¶
func (a *Application) NzbsTv(c echo.Context, tvdbid string, season, episode int) error
func (*Application) NzbsTvHandler ¶
func (a *Application) NzbsTvHandler(c echo.Context) error
func (*Application) ReleasesIndex ¶
func (*Application) ReleasesIndexHandler ¶
func (a *Application) ReleasesIndexHandler(c echo.Context) error
Releases (/releases)
func (*Application) Routes ¶
func (a *Application) Routes()
func (*Application) RunicIndex ¶
func (a *Application) RunicIndex(c echo.Context, start, limit int, type_, text string, year, season, episode int, group, website string, resolution int, source string, uncensored, bluray, verified, exact bool) error
GET /runic/
func (*Application) RunicIndexHandler ¶
func (a *Application) RunicIndexHandler(c echo.Context) error
Runic (/runic)
func (*Application) SearchIndex ¶
func (a *Application) SearchIndex(c echo.Context, start, limit int, types, q, name string) error
func (*Application) SearchIndexHandler ¶
func (a *Application) SearchIndexHandler(c echo.Context) error
Search (/search)
type Config ¶
type Config struct { Mode string `env:"MODE" envDefault:"dev"` Logger string `env:"LOGGER" envDefault:"dev"` Port int `env:"PORT" envDefault:"10080"` //golem:template:app/config_partial_struct // DO NOT EDIT. This section is managed by github.com/dashotv/golem. // Models (Database) Connections ConnectionSet `env:"CONNECTIONS,required"` // Router Auth Auth bool `env:"AUTH" envDefault:"false"` ClerkSecretKey string `env:"CLERK_SECRET_KEY"` ClerkToken string `env:"CLERK_TOKEN"` // Events NatsURL string `env:"NATS_URL,required"` ElasticsearchURL string `env:"ELASTICSEARCH_URL,required"` NzbgeekKey string `env:"NZBGEEK_KEY,required"` NzbgeekURL string `env:"NZBGEEK_URL,required"` TvdbKey string `env:"TVDB_KEY,required"` TmdbToken string `env:"TMDB_TOKEN,required"` Production bool `env:"PRODUCTION" envDefault:"false"` }
func (*Config) ConnectionFor ¶
func (c *Config) ConnectionFor(name string) (*Connection, error)
type Connection ¶
type Connection struct { URI string `yaml:"uri,omitempty"` Database string `yaml:"database,omitempty"` Collection string `yaml:"collection,omitempty"` }
func (*Connection) UnmarshalText ¶
func (c *Connection) UnmarshalText(text []byte) error
type ConnectionSet ¶
type ConnectionSet map[string]*Connection
func (*ConnectionSet) UnmarshalText ¶
func (c *ConnectionSet) UnmarshalText(text []byte) error
type Connector ¶
type Connector struct {
Log *zap.SugaredLogger
}
func NewConnector ¶
func NewConnector(app *Application) (*Connector, error)
type ElasticSearchIndexPayload ¶
type ElasticSearchIndexPayload struct { Index string Model interface{} }
type EventEpisodes ¶ added in v0.10.5
type EventMovies ¶
type EventSeries ¶
type Events ¶
type Events struct { App *Application Merc *mercury.Mercury Log *zap.SugaredLogger Episodes chan *EventEpisodes Movies chan *EventMovies Releases chan *search.Release Runic chan *runic.Release Series chan *EventSeries }
func NewEvents ¶
func NewEvents(app *Application) (*Events, error)
type EventsChannel ¶
type EventsChannel string
type EventsTopic ¶
type EventsTopic string
type H ¶
stolen from gin gonic H is a shortcut for map[string]any
func (H) MarshalXML ¶
MarshalXML allows type H to be used with xml.Marshal.
type SearchAllResponse ¶
type SearchAllResponse struct { Media *SearchResponse `bson:"media" json:"media"` Tmdb *SearchResponse `bson:"tmdb" json:"tmdb"` Tvdb *SearchResponse `bson:"tvdb" json:"tvdb"` }
type SearchResponse ¶
type SearchResponse struct { Results []*SearchResult `bson:"results" json:"results"` Error string `bson:"error" json:"error"` }
type SearchResult ¶
type SearchResult struct { ID string `bson:"id" json:"id"` Title string `bson:"title" json:"title"` Description string `bson:"description" json:"description"` Type string `bson:"type" json:"type"` Kind string `bson:"kind" json:"kind"` Date string `bson:"date" json:"date"` Source string `bson:"source" json:"source"` Image string `bson:"image" json:"image"` Completed bool `bson:"completed" json:"completed"` }
type SettingsBatch ¶
Source Files ¶
- app.go
- client.go
- config.go
- elasticsearch.go
- events.gen.go
- events_episodes.go
- events_movies.go
- events_releases.go
- events_runic.go
- events_series.go
- logger.go
- models.gen.go
- nzbgeek.go
- routes.gen.go
- routes_es.go
- routes_media.go
- routes_nzbs.go
- routes_releases.go
- routes_runic.go
- routes_search.go
- tmdb.go
- tvdb.go
- utils.go