config

package
v1.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterArrFlags

func RegisterArrFlags(flags *flag.FlagSet)

func RegisterProwlarrFlags

func RegisterProwlarrFlags(flags *flag.FlagSet)

Types

type ArrConfig

type ArrConfig struct {
	App                     string         `koanf:"app"`
	ApiVersion              string         `koanf:"api-version" validate:"required|in:v1,v3"`
	XMLConfig               string         `koanf:"config"`
	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"`
	URL                     string         `koanf:"url" validate:"required|url"`                        // stores rendered Arr URL (with api version)
	ApiKey                  string         `koanf:"api-key" validate:"required|regex:(^[a-z0-9]{32}$)"` // stores the API key
	DisableSSLVerify        bool           `koanf:"disable-ssl-verify"`                                 // stores the disable SSL verify flag
	Prowlarr                ProwlarrConfig `koanf:"prowlarr"`
	// contains filtered or unexported fields
}

func LoadArrConfig

func LoadArrConfig(conf base_config.Config, flags *flag.FlagSet) (*ArrConfig, error)

func (*ArrConfig) BaseURL

func (c *ArrConfig) BaseURL() string

func (*ArrConfig) LoadProwlarrConfig

func (c *ArrConfig) LoadProwlarrConfig(flags *flag.FlagSet) error

func (ArrConfig) Messages

func (c ArrConfig) Messages() map[string]string

func (ArrConfig) Translates

func (c ArrConfig) Translates() map[string]string

func (*ArrConfig) UseBasicAuth

func (c *ArrConfig) UseBasicAuth() bool

func (*ArrConfig) UseFormAuth

func (c *ArrConfig) UseFormAuth() bool

func (*ArrConfig) Validate

func (c *ArrConfig) Validate() error

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

type XML

type XML struct{}

func XMLParser

func XMLParser() *XML

func (*XML) Marshal

func (p *XML) Marshal(o map[string]interface{}) ([]byte, error)

func (*XML) Merge

func (p *XML) Merge(baseURL string) func(src, dest map[string]interface{}) error

func (*XML) Unmarshal

func (p *XML) Unmarshal(b []byte) (map[string]interface{}, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL