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.
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 QueryParamBool(c echo.Context, name string) bool
- func QueryParamBoolDefault(c echo.Context, name string, def string) bool
- func QueryParamFloatDefault(c echo.Context, name string, def string) float64
- func QueryParamInt(c echo.Context, name string) int
- func QueryParamIntDefault(c echo.Context, name string, def string) int
- func QueryParamString(c echo.Context, name string) string
- func QueryParamStringDefault(c echo.Context, name string, def string) string
- func QueryString(c echo.Context, name string) string
- func Setup() error
- func Start() error
- func Updates() 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) MetubeAdd(c echo.Context, url string, name string, autoStart bool) error
- func (a *Application) MetubeAddHandler(c echo.Context) error
- func (a *Application) MetubeIndex(c echo.Context) error
- func (a *Application) MetubeIndexHandler(c echo.Context) error
- func (a *Application) MetubeRemove(c echo.Context, name string, where string) error
- func (a *Application) MetubeRemoveHandler(c echo.Context) error
- func (a *Application) NzbsAdd(c echo.Context, URL, cat, name string) error
- func (a *Application) NzbsAddHandler(c echo.Context) error
- func (a *Application) NzbsDestroy(c echo.Context, id int) error
- func (a *Application) NzbsDestroyHandler(c echo.Context) error
- func (a *Application) NzbsHistory(c echo.Context, hidden bool) error
- func (a *Application) NzbsHistoryHandler(c echo.Context) error
- func (a *Application) NzbsIndex(c echo.Context) error
- func (a *Application) NzbsIndexHandler(c echo.Context) error
- func (a *Application) NzbsPause(c echo.Context, id int) error
- func (a *Application) NzbsPauseAll(c echo.Context) error
- func (a *Application) NzbsPauseHandler(c echo.Context) error
- func (a *Application) NzbsRemove(c echo.Context, id int) error
- func (a *Application) NzbsRemoveHandler(c echo.Context) error
- func (a *Application) NzbsResume(c echo.Context, id int) error
- func (a *Application) NzbsResumeAll(c echo.Context) error
- func (a *Application) NzbsResumeHandler(c echo.Context) error
- func (a *Application) QbittorrentsAdd(c echo.Context, URL string) error
- func (a *Application) QbittorrentsAddHandler(c echo.Context) error
- func (a *Application) QbittorrentsIndex(c echo.Context) error
- func (a *Application) QbittorrentsIndexHandler(c echo.Context) error
- func (a *Application) QbittorrentsLabel(c echo.Context, infohash, label string) error
- func (a *Application) QbittorrentsLabelHandler(c echo.Context) error
- func (a *Application) QbittorrentsPause(c echo.Context, infohash string) error
- func (a *Application) QbittorrentsPauseAll(c echo.Context) error
- func (a *Application) QbittorrentsPauseHandler(c echo.Context) error
- func (a *Application) QbittorrentsRemove(c echo.Context, infohash string, del bool) error
- func (a *Application) QbittorrentsRemoveHandler(c echo.Context) error
- func (a *Application) QbittorrentsResume(c echo.Context, infohash string) error
- func (a *Application) QbittorrentsResumeAll(c echo.Context) error
- func (a *Application) QbittorrentsResumeHandler(c echo.Context) error
- func (a *Application) QbittorrentsWant(c echo.Context, infohash, files string) error
- func (a *Application) QbittorrentsWantHandler(c echo.Context) error
- func (a *Application) QbittorrentsWantNone(c echo.Context, infohash string) error
- func (a *Application) QbittorrentsWanted(c echo.Context, infohash string) error
- func (a *Application) QbittorrentsWantedHandler(c echo.Context) error
- func (a *Application) Routes()
- type Cache
- type Combined
- type Config
- type Connection
- type ConnectionSet
- type Connector
- type Events
- type EventsChannel
- type EventsTopic
- type H
- type Metrics
- type Response
- 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 QueryParamBool ¶
QueryParamBool retrieves a boolean param from the gin request querystring
func QueryParamBoolDefault ¶
func QueryParamFloatDefault ¶
func QueryParamInt ¶
QueryParamInt retrieves an integer param from the gin request querystring
func QueryParamIntDefault ¶
func QueryParamString ¶
QueryParamString retrieves a string param from the gin request querystring
func QueryParamStringDefault ¶
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 Nzb *nzbget.Client Qbt *qbt.Api Metube *metube.Client //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 //Cache Cache *Cache }
func (*Application) MetubeAdd ¶
func (a *Application) MetubeAdd(c echo.Context, url string, name string, autoStart bool) error
GET /metube/add
func (*Application) MetubeAddHandler ¶
func (a *Application) MetubeAddHandler(c echo.Context) error
func (*Application) MetubeIndex ¶
func (a *Application) MetubeIndex(c echo.Context) error
GET /metube/
func (*Application) MetubeIndexHandler ¶
func (a *Application) MetubeIndexHandler(c echo.Context) error
Metube (/metube)
func (*Application) MetubeRemove ¶
func (a *Application) MetubeRemove(c echo.Context, name string, where string) error
GET /metube/remove
func (*Application) MetubeRemoveHandler ¶
func (a *Application) MetubeRemoveHandler(c echo.Context) error
func (*Application) NzbsAdd ¶
func (a *Application) NzbsAdd(c echo.Context, URL, cat, name string) error
func (*Application) NzbsAddHandler ¶
func (a *Application) NzbsAddHandler(c echo.Context) error
func (*Application) NzbsDestroy ¶
func (a *Application) NzbsDestroy(c echo.Context, id int) error
func (*Application) NzbsDestroyHandler ¶
func (a *Application) NzbsDestroyHandler(c echo.Context) error
func (*Application) NzbsHistory ¶
func (a *Application) NzbsHistory(c echo.Context, hidden bool) error
func (*Application) NzbsHistoryHandler ¶
func (a *Application) NzbsHistoryHandler(c echo.Context) error
func (*Application) NzbsIndex ¶
func (a *Application) NzbsIndex(c echo.Context) error
func (*Application) NzbsIndexHandler ¶
func (a *Application) NzbsIndexHandler(c echo.Context) error
Nzbs (/nzbs)
func (*Application) NzbsPause ¶
func (a *Application) NzbsPause(c echo.Context, id int) error
func (*Application) NzbsPauseAll ¶
func (a *Application) NzbsPauseAll(c echo.Context) error
func (*Application) NzbsPauseHandler ¶
func (a *Application) NzbsPauseHandler(c echo.Context) error
func (*Application) NzbsRemove ¶
func (a *Application) NzbsRemove(c echo.Context, id int) error
func (*Application) NzbsRemoveHandler ¶
func (a *Application) NzbsRemoveHandler(c echo.Context) error
func (*Application) NzbsResume ¶
func (a *Application) NzbsResume(c echo.Context, id int) error
func (*Application) NzbsResumeAll ¶
func (a *Application) NzbsResumeAll(c echo.Context) error
func (*Application) NzbsResumeHandler ¶
func (a *Application) NzbsResumeHandler(c echo.Context) error
func (*Application) QbittorrentsAdd ¶
func (a *Application) QbittorrentsAdd(c echo.Context, URL string) error
func (*Application) QbittorrentsAddHandler ¶
func (a *Application) QbittorrentsAddHandler(c echo.Context) error
func (*Application) QbittorrentsIndex ¶
func (a *Application) QbittorrentsIndex(c echo.Context) error
func (*Application) QbittorrentsIndexHandler ¶
func (a *Application) QbittorrentsIndexHandler(c echo.Context) error
Qbittorrents (/qbittorrents)
func (*Application) QbittorrentsLabel ¶
func (a *Application) QbittorrentsLabel(c echo.Context, infohash, label string) error
func (*Application) QbittorrentsLabelHandler ¶
func (a *Application) QbittorrentsLabelHandler(c echo.Context) error
func (*Application) QbittorrentsPause ¶
func (a *Application) QbittorrentsPause(c echo.Context, infohash string) error
func (*Application) QbittorrentsPauseAll ¶
func (a *Application) QbittorrentsPauseAll(c echo.Context) error
func (*Application) QbittorrentsPauseHandler ¶
func (a *Application) QbittorrentsPauseHandler(c echo.Context) error
func (*Application) QbittorrentsRemove ¶
func (a *Application) QbittorrentsRemove(c echo.Context, infohash string, del bool) error
func (*Application) QbittorrentsRemoveHandler ¶
func (a *Application) QbittorrentsRemoveHandler(c echo.Context) error
func (*Application) QbittorrentsResume ¶
func (a *Application) QbittorrentsResume(c echo.Context, infohash string) error
func (*Application) QbittorrentsResumeAll ¶
func (a *Application) QbittorrentsResumeAll(c echo.Context) error
func (*Application) QbittorrentsResumeHandler ¶
func (a *Application) QbittorrentsResumeHandler(c echo.Context) error
func (*Application) QbittorrentsWant ¶
func (a *Application) QbittorrentsWant(c echo.Context, infohash, files string) error
func (*Application) QbittorrentsWantHandler ¶
func (a *Application) QbittorrentsWantHandler(c echo.Context) error
func (*Application) QbittorrentsWantNone ¶
func (a *Application) QbittorrentsWantNone(c echo.Context, infohash string) error
func (*Application) QbittorrentsWanted ¶
func (a *Application) QbittorrentsWanted(c echo.Context, infohash string) error
func (*Application) QbittorrentsWantedHandler ¶
func (a *Application) QbittorrentsWantedHandler(c echo.Context) error
func (*Application) Routes ¶
func (a *Application) Routes()
type Config ¶
type Config struct { Mode string `env:"MODE" envDefault:"dev"` Logger string `env:"LOGGER" envDefault:"dev"` Port int `env:"PORT" envDefault:"10080"` QbittorrentURL string `env:"QBITTORRENT_URL"` QbittorrentUsername string `env:"QBITTORRENT_USERNAME"` QbittorrentPassword string `env:"QBITTORRENT_PASSWORD"` MetubeURL string `env:"METUBE_URL"` NzbgetURL string `env:"NZBGET_URL"` RedisHost string `env:"REDIS_HOST"` RedisPort string `env:"REDIS_PORT"` RedisDatabase int `env:"REDIS_DATABASE"` //golem:template:app/config_partial_struct // DO NOT EDIT. This section is managed by github.com/dashotv/golem. // Models (Database) Connections ConnectionSet `env:"CONNECTIONS"` // Cache RedisAddress string `env:"REDIS_ADDRESS"` // 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"` // 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"` }
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 Events ¶
type Events struct { App *Application Merc *mercury.Mercury Log *zap.SugaredLogger Combined chan *Combined Metrics chan *Metrics Nzbs chan *nzbget.GroupResponse Qbittorrents chan *qbt.Response }
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.