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.
Code generated by github.com/dashotv/golem. DO NOT EDIT.
Code generated by github.com/dashotv/golem. DO NOT EDIT.
Index ¶
- func QueryBool(c echo.Context, name string) bool
- func QueryDefaultInteger(c echo.Context, name string, def int) (int, error)
- 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) Health() (map[string]bool, error)
- func (a *Application) IndexersCreate(c echo.Context) error
- func (a *Application) IndexersCreateHandler(c echo.Context) error
- func (a *Application) IndexersDelete(c echo.Context, id string) error
- func (a *Application) IndexersDeleteHandler(c echo.Context) error
- func (a *Application) IndexersIndex(c echo.Context, page int, limit int) error
- func (a *Application) IndexersIndexHandler(c echo.Context) error
- func (a *Application) IndexersSettings(c echo.Context, id string) error
- func (a *Application) IndexersSettingsHandler(c echo.Context) error
- func (a *Application) IndexersShow(c echo.Context, id string) error
- func (a *Application) IndexersShowHandler(c echo.Context) error
- func (a *Application) IndexersUpdate(c echo.Context, id string) error
- func (a *Application) IndexersUpdateHandler(c echo.Context) error
- func (a *Application) JobsCreate(c echo.Context) error
- func (a *Application) JobsCreateHandler(c echo.Context) error
- func (a *Application) JobsDelete(c echo.Context, id string) error
- func (a *Application) JobsDeleteHandler(c echo.Context) error
- func (a *Application) JobsIndex(c echo.Context, page int, limit int) error
- func (a *Application) JobsIndexHandler(c echo.Context) error
- func (a *Application) JobsSettings(c echo.Context, id string) error
- func (a *Application) JobsSettingsHandler(c echo.Context) error
- func (a *Application) JobsShow(c echo.Context, id string) error
- func (a *Application) JobsShowHandler(c echo.Context) error
- func (a *Application) JobsUpdate(c echo.Context, id string) error
- func (a *Application) JobsUpdateHandler(c echo.Context) error
- func (a *Application) ReleasesCreate(c echo.Context) error
- func (a *Application) ReleasesCreateHandler(c echo.Context) error
- func (a *Application) ReleasesDelete(c echo.Context, id string) error
- func (a *Application) ReleasesDeleteHandler(c echo.Context) error
- func (a *Application) ReleasesIndex(c echo.Context, page int, limit int) error
- func (a *Application) ReleasesIndexHandler(c echo.Context) error
- func (a *Application) ReleasesSettings(c echo.Context, id string) error
- func (a *Application) ReleasesSettingsHandler(c echo.Context) error
- func (a *Application) ReleasesShow(c echo.Context, id string) error
- func (a *Application) ReleasesShowHandler(c echo.Context) error
- func (a *Application) ReleasesUpdate(c echo.Context, id string) error
- func (a *Application) ReleasesUpdateHandler(c echo.Context) error
- func (a *Application) Routes()
- func (a *Application) SourcesCreate(c echo.Context) error
- func (a *Application) SourcesCreateHandler(c echo.Context) error
- func (a *Application) SourcesDelete(c echo.Context, id string) error
- func (a *Application) SourcesDeleteHandler(c echo.Context) error
- func (a *Application) SourcesIndex(c echo.Context, page int, limit int) error
- func (a *Application) SourcesIndexHandler(c echo.Context) error
- func (a *Application) SourcesParse(c echo.Context, id string) error
- func (a *Application) SourcesParseHandler(c echo.Context) error
- func (a *Application) SourcesRead(c echo.Context, id string) error
- func (a *Application) SourcesReadHandler(c echo.Context) error
- func (a *Application) SourcesSearch(c echo.Context, id string, query string, searchType string) error
- func (a *Application) SourcesSearchHandler(c echo.Context) error
- func (a *Application) SourcesSettings(c echo.Context, id string) error
- func (a *Application) SourcesSettingsHandler(c echo.Context) error
- func (a *Application) SourcesShow(c echo.Context, id string) error
- func (a *Application) SourcesShowHandler(c echo.Context) error
- func (a *Application) SourcesUpdate(c echo.Context, id string) error
- func (a *Application) SourcesUpdateHandler(c echo.Context) error
- type Config
- type Connection
- type ConnectionSet
- type Connector
- func (c *Connector) IndexerActive() ([]*Indexer, error)
- func (c *Connector) IndexerGet(id string) (*Indexer, error)
- func (c *Connector) IndexerList(page, limit int) ([]*Indexer, int64, error)
- func (c *Connector) MinionGet(id string) (*Minion, error)
- func (c *Connector) MinionList(limit, skip int) ([]*Minion, error)
- func (c *Connector) ReleaseGet(id string) (*Release, error)
- func (c *Connector) ReleaseList(page, limit int) ([]*Release, int64, error)
- func (c *Connector) ReleaseSetting(id, setting string, value bool) error
- func (c *Connector) ReleasesAll() ([]*Release, error)
- type Count
- type Events
- type EventsChannel
- type EventsTopic
- type H
- type Indexer
- type Minion
- type MinionAttempt
- type ParseActive
- type ParseIndexer
- type ParseRift
- type ParseRiftAll
- type Processor
- type Release
- type RunicSourceSimple
- type Setting
- type UpdateIndexes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func QueryDefaultInteger ¶
QueryDefaultInt retrieves an integer param from the gin request querystring defaults to def argument if not found
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 Reader *reader.Reader Rift *rift.Client Processor *Processor //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 // Workers Workers *minion.Minion }
func (*Application) IndexersCreate ¶
func (a *Application) IndexersCreate(c echo.Context) error
func (*Application) IndexersCreateHandler ¶
func (a *Application) IndexersCreateHandler(c echo.Context) error
func (*Application) IndexersDelete ¶
func (a *Application) IndexersDelete(c echo.Context, id string) error
func (*Application) IndexersDeleteHandler ¶
func (a *Application) IndexersDeleteHandler(c echo.Context) error
func (*Application) IndexersIndex ¶
func (a *Application) IndexersIndex(c echo.Context, page int, limit int) error
func (*Application) IndexersIndexHandler ¶
func (a *Application) IndexersIndexHandler(c echo.Context) error
Indexers (/indexers)
func (*Application) IndexersSettings ¶
func (a *Application) IndexersSettings(c echo.Context, id string) error
func (*Application) IndexersSettingsHandler ¶
func (a *Application) IndexersSettingsHandler(c echo.Context) error
func (*Application) IndexersShow ¶
func (a *Application) IndexersShow(c echo.Context, id string) error
func (*Application) IndexersShowHandler ¶
func (a *Application) IndexersShowHandler(c echo.Context) error
func (*Application) IndexersUpdate ¶
func (a *Application) IndexersUpdate(c echo.Context, id string) error
func (*Application) IndexersUpdateHandler ¶
func (a *Application) IndexersUpdateHandler(c echo.Context) error
func (*Application) JobsCreate ¶
func (a *Application) JobsCreate(c echo.Context) error
POST /minion/
func (*Application) JobsCreateHandler ¶
func (a *Application) JobsCreateHandler(c echo.Context) error
func (*Application) JobsDelete ¶
func (a *Application) JobsDelete(c echo.Context, id string) error
DELETE /minion/:id
func (*Application) JobsDeleteHandler ¶
func (a *Application) JobsDeleteHandler(c echo.Context) error
func (*Application) JobsIndex ¶
func (a *Application) JobsIndex(c echo.Context, page int, limit int) error
GET /minion/
func (*Application) JobsIndexHandler ¶
func (a *Application) JobsIndexHandler(c echo.Context) error
Jobs (/jobs)
func (*Application) JobsSettings ¶
func (a *Application) JobsSettings(c echo.Context, id string) error
PATCH /minion/:id
func (*Application) JobsSettingsHandler ¶
func (a *Application) JobsSettingsHandler(c echo.Context) error
func (*Application) JobsShow ¶
func (a *Application) JobsShow(c echo.Context, id string) error
GET /minion/:id
func (*Application) JobsShowHandler ¶
func (a *Application) JobsShowHandler(c echo.Context) error
func (*Application) JobsUpdate ¶
func (a *Application) JobsUpdate(c echo.Context, id string) error
PUT /minion/:id
func (*Application) JobsUpdateHandler ¶
func (a *Application) JobsUpdateHandler(c echo.Context) error
func (*Application) ReleasesCreate ¶
func (a *Application) ReleasesCreate(c echo.Context) error
POST /releases/
func (*Application) ReleasesCreateHandler ¶
func (a *Application) ReleasesCreateHandler(c echo.Context) error
func (*Application) ReleasesDelete ¶
func (a *Application) ReleasesDelete(c echo.Context, id string) error
DELETE /releases/:id
func (*Application) ReleasesDeleteHandler ¶
func (a *Application) ReleasesDeleteHandler(c echo.Context) error
func (*Application) ReleasesIndex ¶
func (a *Application) ReleasesIndex(c echo.Context, page int, limit int) error
GET /releases/
func (*Application) ReleasesIndexHandler ¶
func (a *Application) ReleasesIndexHandler(c echo.Context) error
Releases (/releases)
func (*Application) ReleasesSettings ¶
func (a *Application) ReleasesSettings(c echo.Context, id string) error
PATCH /releases/:id
func (*Application) ReleasesSettingsHandler ¶
func (a *Application) ReleasesSettingsHandler(c echo.Context) error
func (*Application) ReleasesShow ¶
func (a *Application) ReleasesShow(c echo.Context, id string) error
GET /releases/:id
func (*Application) ReleasesShowHandler ¶
func (a *Application) ReleasesShowHandler(c echo.Context) error
func (*Application) ReleasesUpdate ¶
func (a *Application) ReleasesUpdate(c echo.Context, id string) error
PUT /releases/:id
func (*Application) ReleasesUpdateHandler ¶
func (a *Application) ReleasesUpdateHandler(c echo.Context) error
func (*Application) Routes ¶
func (a *Application) Routes()
func (*Application) SourcesCreate ¶
func (a *Application) SourcesCreate(c echo.Context) error
func (*Application) SourcesCreateHandler ¶
func (a *Application) SourcesCreateHandler(c echo.Context) error
func (*Application) SourcesDelete ¶
func (a *Application) SourcesDelete(c echo.Context, id string) error
func (*Application) SourcesDeleteHandler ¶
func (a *Application) SourcesDeleteHandler(c echo.Context) error
func (*Application) SourcesIndex ¶
func (a *Application) SourcesIndex(c echo.Context, page int, limit int) error
func (*Application) SourcesIndexHandler ¶
func (a *Application) SourcesIndexHandler(c echo.Context) error
Sources (/sources)
func (*Application) SourcesParse ¶
func (a *Application) SourcesParse(c echo.Context, id string) error
func (*Application) SourcesParseHandler ¶
func (a *Application) SourcesParseHandler(c echo.Context) error
func (*Application) SourcesRead ¶
func (a *Application) SourcesRead(c echo.Context, id string) error
func (*Application) SourcesReadHandler ¶
func (a *Application) SourcesReadHandler(c echo.Context) error
func (*Application) SourcesSearch ¶
func (a *Application) SourcesSearch(c echo.Context, id string, query string, searchType string) error
func (*Application) SourcesSearchHandler ¶
func (a *Application) SourcesSearchHandler(c echo.Context) error
func (*Application) SourcesSettings ¶
func (a *Application) SourcesSettings(c echo.Context, id string) error
func (*Application) SourcesSettingsHandler ¶
func (a *Application) SourcesSettingsHandler(c echo.Context) error
func (*Application) SourcesShow ¶
func (a *Application) SourcesShow(c echo.Context, id string) error
func (*Application) SourcesShowHandler ¶
func (a *Application) SourcesShowHandler(c echo.Context) error
func (*Application) SourcesUpdate ¶
func (a *Application) SourcesUpdate(c echo.Context, id string) error
func (*Application) SourcesUpdateHandler ¶
func (a *Application) SourcesUpdateHandler(c echo.Context) error
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"` // Router Auth Auth bool `env:"AUTH" envDefault:"false"` ClerkSecretKey string `env:"CLERK_SECRET_KEY"` // Events NatsURL string `env:"NATS_URL"` // Workers MinionConcurrency int `env:"MINION_CONCURRENCY" envDefault:"10"` MinionDebug bool `env:"MINION_DEBUG" envDefault:"false"` MinionBufferSize int `env:"MINION_BUFFER_SIZE" envDefault:"100"` MinionURI string `env:"MINION_URI"` MinionDatabase string `env:"MINION_DATABASE"` MinionCollection string `env:"MINION_COLLECTION"` RiftURL string `env:"RIFT_URL"` Words []string `env:"WORDS"` }
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 Indexer *grimoire.Store[*Indexer] Minion *grimoire.Store[*Minion] Release *grimoire.Store[*Release] }
func NewConnector ¶
func NewConnector(app *Application) (*Connector, error)
func (*Connector) IndexerActive ¶
func (*Connector) IndexerList ¶
func (*Connector) ReleaseList ¶
func (*Connector) ReleaseSetting ¶
func (*Connector) ReleasesAll ¶
type Events ¶
type Events struct { App *Application Merc *mercury.Mercury Log *zap.SugaredLogger Releases chan *Release }
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 Indexer ¶
type Indexer struct { grimoire.Document `bson:",inline"` // includes default model settings //ID primitive.ObjectID `bson:"_id,omitempty" json:"id"` //CreatedAt time.Time `bson:"created_at" json:"created_at"` //UpdatedAt time.Time `bson:"updated_at" json:"updated_at"` Name string `bson:"name" json:"name"` Url string `bson:"url" json:"url"` Active bool `bson:"active" json:"active"` Categories []int `bson:"categories" json:"categories"` ProcessedAt time.Time `bson:"processed_at" json:"processed_at"` }
type Minion ¶
type Minion struct { grimoire.Document `bson:",inline"` // includes default model settings //ID primitive.ObjectID `bson:"_id,omitempty" json:"id"` //CreatedAt time.Time `bson:"created_at" json:"created_at"` //UpdatedAt time.Time `bson:"updated_at" json:"updated_at"` Kind string `bson:"kind" json:"kind"` Args string `bson:"args" json:"args"` Status string `bson:"status" json:"status"` Queue string `bson:"queue" json:"queue"` Attempts []*MinionAttempt `bson:"attempts" json:"attempts"` }
type MinionAttempt ¶
type ParseActive ¶
type ParseActive struct { minion.WorkerDefaults[*ParseActive] }
func (*ParseActive) Kind ¶
func (j *ParseActive) Kind() string
func (*ParseActive) Work ¶
func (j *ParseActive) Work(ctx context.Context, job *minion.Job[*ParseActive]) error
type ParseIndexer ¶
type ParseIndexer struct { minion.WorkerDefaults[*ParseIndexer] ID string `bson:"id" json:"id"` Title string `bson:"title" json:"title"` }
func (*ParseIndexer) Kind ¶
func (j *ParseIndexer) Kind() string
func (*ParseIndexer) Work ¶
func (j *ParseIndexer) Work(ctx context.Context, job *minion.Job[*ParseIndexer]) error
type ParseRift ¶
type ParseRift struct { minion.WorkerDefaults[*ParseRift] }
type ParseRiftAll ¶ added in v0.3.0
type ParseRiftAll struct { minion.WorkerDefaults[*ParseRiftAll] }
func (*ParseRiftAll) Kind ¶ added in v0.3.0
func (j *ParseRiftAll) Kind() string
func (*ParseRiftAll) Work ¶ added in v0.3.0
func (j *ParseRiftAll) Work(ctx context.Context, job *minion.Job[*ParseRiftAll]) error
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
type Release ¶
type Release struct { grimoire.Document `bson:",inline"` // includes default model settings //ID primitive.ObjectID `bson:"_id,omitempty" json:"id"` //CreatedAt time.Time `bson:"created_at" json:"created_at"` //UpdatedAt time.Time `bson:"updated_at" json:"updated_at"` Type string `bson:"type" json:"type"` Source string `bson:"source" json:"source"` Title string `bson:"title" json:"title"` Year int `bson:"year" json:"year"` Description string `bson:"description" json:"description"` Size int64 `bson:"size" json:"size"` View string `bson:"view" json:"view"` Download string `bson:"download" json:"download"` Infohash string `bson:"infohash" json:"infohash"` Season int `bson:"season" json:"season"` Episode int `bson:"episode" json:"episode"` Volume int `bson:"volume" json:"volume"` Group string `bson:"group" json:"group"` Website string `bson:"website" json:"website"` Verified bool `bson:"verified" json:"verified"` Widescreen bool `bson:"widescreen" json:"widescreen"` Unrated bool `bson:"unrated" json:"unrated"` Uncensored bool `bson:"uncensored" json:"uncensored"` Bluray bool `bson:"bluray" json:"bluray"` ThreeD bool `bson:"threeD" json:"threeD"` Resolution string `bson:"resolution" json:"resolution"` Encodings []string `bson:"encodings" json:"encodings"` Quality string `bson:"quality" json:"quality"` Raw *newznab.NZB `bson:"raw" json:"raw"` Info *parser.TorrentInfo `bson:"info" json:"info"` Downloader string `bson:"downloader" json:"downloader"` Checksum string `bson:"checksum" json:"checksum"` PublishedAt time.Time `bson:"published_at" json:"published_at"` }
type RunicSourceSimple ¶
type UpdateIndexes ¶ added in v0.3.0
type UpdateIndexes struct { minion.WorkerDefaults[*UpdateIndexes] }
func (*UpdateIndexes) Kind ¶ added in v0.3.0
func (j *UpdateIndexes) Kind() string
func (*UpdateIndexes) Timeout ¶ added in v0.3.0
func (j *UpdateIndexes) Timeout(job *minion.Job[*UpdateIndexes]) time.Duration
func (*UpdateIndexes) Work ¶ added in v0.3.0
func (j *UpdateIndexes) Work(ctx context.Context, job *minion.Job[*UpdateIndexes]) error