config

package
v1.0.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfigPath

func DefaultConfigPath() string

DefaultConfigPath returns the default path to the config file

func UserDir

func UserDir() (string, error)

UserDir returns the user home directory

Types

type Config

type Config struct {
	DBPath      string `toml:"db_path"`
	FeedWatcher feedWatcherOptions

	Downloader DownloaderOptions

	Debrider DebriderOptions

	Providers map[string]ProviderOptions

	WebServer WebServerOptions

	Teller TellerOptions
	// contains filtered or unexported fields
}

Config defines the Christopher configuration

func Load

func Load() (*Config, error)

Load loads config from the default config path

func LoadFromFile

func LoadFromFile(configPath string) (*Config, error)

LoadFromFile loads the configuration from a file

type DebriderOptions

type DebriderOptions struct {
	Name      string
	AuthInfos map[string]string `toml:"auth_infos"`
}

DebriderOptions defines name and auth info for the debrider

type DownloaderOptions

type DownloaderOptions struct {
	Name            string
	AuthInfos       map[string]interface{} `toml:"auth_infos"`
	DownloadOptions map[string]interface{} `toml:"download_options"`
}

DownloaderOptions defines options for the downloader

type ProviderOptions

type ProviderOptions struct {
	FavoriteHosts []string `toml:"favorite_hosts"`
}

ProviderOptions specify options for a given provider

type TellerOptions

type TellerOptions struct {
	// LogLevel is a level from when the Teller must log things
	LogLevel string `toml:"log_level"`

	// LogFormatter is the log items format
	LogFormatter string `toml:"log_formatter"`
}

TellerOptions defines logging options for the Teller

type WebServerOptions

type WebServerOptions struct {
	Port int
	Host string

	// Secret is the secret for the CSRF token generation
	Secret string

	// SecureCookie constrains CSRF cookie to be HTTPS only if true
	SecureCookie bool `toml:"secure_cookie"`

	// AuthRealm is the realm for the HTTP digest auth
	AuthRealm string `toml:"auth_realm"`

	// Users are a list of allowed users.
	// If no users are given, no Digest auth is setup.
	Users []webUser
}

WebServerOptions defines some of the webserver options

Jump to

Keyboard shortcuts

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