Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrMissingDetailerNames = errors.New("configuration: missing detailer names") ErrMissingTorrenterNames = errors.New("configuration: missing torrenter names") )
Custom errors
var (
ErrMissingModuleParams = errors.New("configuration: missing module params")
)
Custom errors
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Logger *logrus.Logger Watcher WatcherConfig Downloader DownloaderConfig DownloadManager DownloadManagerConfig HTTPServer HTTPServer Wishlist polochon.WishlistConfig Movie polochon.MovieConfig Show polochon.ShowConfig File polochon.FileConfig Library LibraryConfig Notifiers []polochon.Notifier SubtitleLanguages []polochon.Language }
Config represents the configuration for polochon
func LoadConfig ¶
LoadConfig loads the configuration from a reader
func LoadConfigFile ¶
LoadConfigFile reads a file from a path and returns a config
func (*Config) ModulesStatus ¶
func (c *Config) ModulesStatus() ModulesStatuses
ModulesStatus gives the status of the modules configured
func (*Config) UnmarshalYAML ¶
UnmarshalYAML implements the Unmarshaler interface
type DownloadManagerConfig ¶
type DownloadManagerConfig struct { Enabled bool `yaml:"enabled"` Dir string `yaml:"dir"` Timer time.Duration `yaml:"timer"` Ratio float32 `yaml:"ratio"` }
DownloadManagerConfig represents the configuration for the download manager
type DownloaderConfig ¶
type DownloaderConfig struct { Enabled bool LaunchAtStartup bool Schedule cron.Schedule Client polochon.Downloader }
DownloaderConfig represents the configuration for the downloader
type HTTPServer ¶
type HTTPServer struct { // TODO: enable => enabled Enable bool `yaml:"enable"` Port int `yaml:"port"` Host string `yaml:"host"` ServeFiles bool `yaml:"serve_files"` BasicAuth bool `yaml:"basic_auth"` BasicAuthUser string `yaml:"basic_auth_user"` BasicAuthPassword string `yaml:"basic_auth_password"` LogExcludePaths []string `yaml:"log_exclude_paths"` }
HTTPServer represents the configuration for the HTTP Server
type LibraryConfig ¶
LibraryConfig represents configuration for the library
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger represents a logger
func (*Logger) UnmarshalYAML ¶
UnmarshalYAML implements the Unmarshaler interface
type ModuleFetcher ¶
type ModuleFetcher interface { GetDetailers() []polochon.Detailer GetTorrenters() []polochon.Torrenter GetSearchers() []polochon.Searcher GetExplorers() []polochon.Explorer GetSubtitlers() []polochon.Subtitler }
ModuleFetcher is an interface which allows to get torrenters and detailers ...
type ModuleLoader ¶
type ModuleLoader struct { TorrenterNames []string `yaml:"torrenters"` DetailerNames []string `yaml:"detailers"` SubtitlerNames []string `yaml:"subtitlers"` SearcherNames []string `yaml:"searchers"` ExplorerNames []string `yaml:"explorers"` NotifierNames []string `yaml:"notifiers"` WishlisterNames []string `yaml:"wishlisters"` GuesserNames []string `yaml:"guessers"` CalendarName string `yaml:"calendar"` FsNotifierName string `yaml:"fsnotifier"` DownloaderName string `yaml:"client"` // TODO: fix the name // contains filtered or unexported fields }
ModuleLoader is an helper to be embeded in the configuration structure. It gets the module names from yaml and loads the module using the modules parameters.
type ModuleStatus ¶
type ModuleStatus struct { Name string `json:"name"` Status polochon.ModuleStatus `json:"status"` Error string `json:"error"` }
ModuleStatus represent the status of a module
type ModulesParams ¶
type ModulesParams struct {
// contains filtered or unexported fields
}
ModulesParams holds the module params in raw yaml
func (*ModulesParams) UnmarshalYAML ¶
func (mp *ModulesParams) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements the Unmarshaler interface
type ModulesStatuses ¶
type ModulesStatuses map[string]map[string][]*ModuleStatus
ModulesStatuses represent the status of all the modules
type WatcherConfig ¶
type WatcherConfig struct { Dir string FsNotifier polochon.FsNotifier }
WatcherConfig represents the configuration for the detailers