Documentation ¶
Index ¶
- type Config
- func (c *Config) LoadProwlarrFlags(flags *flag.FlagSet) error
- func (c Config) Messages() map[string]string
- func (c Config) Translates() map[string]string
- func (c *Config) URLLabel() string
- func (c *Config) UseBasicAuth() bool
- func (c *Config) UseFormAuth() bool
- func (c *Config) Validate() error
- func (c Config) ValidateLogLevel(val string) bool
- type ProwlarrConfig
- type XML
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Arr string `koanf:"arr"` LogLevel string `koanf:"log-level" validate:"ValidateLogLevel"` LogFormat string `koanf:"log-format" validate:"in:console,json"` URL string `koanf:"url" validate:"required|url"` ApiKey string `koanf:"api-key" validate:"required|regex:(^[a-z0-9]{32}$)"` ApiKeyFile string `koanf:"api-key-file"` ApiVersion string `koanf:"api-version" validate:"required|in:v3,v4"` XMLConfig string `koanf:"config"` Port int `koanf:"port" validate:"required"` Interface string `koanf:"interface" validate:"required|ip"` DisableSSLVerify bool `koanf:"disable-ssl-verify"` AuthUsername string `koanf:"auth-username"` AuthPassword string `koanf:"auth-password"` FormAuth bool `koanf:"form-auth"` EnableUnknownQueueItems bool `koanf:"enable-unknown-queue-items"` EnableAdditionalMetrics bool `koanf:"enable-additional-metrics"` Prowlarr ProwlarrConfig `koanf:"prowlarr"` // contains filtered or unexported fields }
func (Config) Translates ¶
func (*Config) URLLabel ¶
URLLabel() exists for backwards compatibility -- prior versions built the URL in the client, meaning that the "url" metric label was missing the Port & base path that the XMLConfig provided.
func (*Config) UseBasicAuth ¶
func (*Config) UseFormAuth ¶
func (Config) ValidateLogLevel ¶
ValidateLogLevel validates that the log level is one of the valid log levels gookit/Validate is pretty opinionated, and requires that this is not a pointer method.
type ProwlarrConfig ¶
type ProwlarrConfig struct { Backfill bool `koanf:"backfill"` BackfillSinceDate string `koanf:"backfill-since-date" validate:"date"` BackfillSinceTime time.Time }
func (ProwlarrConfig) Messages ¶
func (p ProwlarrConfig) Messages() map[string]string
func (ProwlarrConfig) Translates ¶
func (p ProwlarrConfig) Translates() map[string]string
func (ProwlarrConfig) Validate ¶
func (p ProwlarrConfig) Validate() error
Click to show internal directories.
Click to hide internal directories.