Documentation ¶
Overview ¶
Package config is resposible for finding, parsing and merging the HTTPMS user configuration with the default. Configuration locations should be different depending on the host OS.
Linux/BSD configurations should be in $HOME/.euterpe/config.json Windows configurations should be in %APPDATA%/euterpe/config.json
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UserConfigPath ¶ added in v1.2.0
UserConfigPath returns the full path to the place where the user's configuration file should be
Types ¶
type Auth ¶ added in v1.0.2
type Auth struct { User string `json:"user,omitempty"` Password string `json:"password,omitempty"` Secret string `json:"secret"` }
Auth represents a configuration HTTP Basic authentication
type Config ¶
type Config struct { Listen string `json:"listen,omitempty"` SSL bool `json:"ssl,omitempty"` SSLCertificate Cert `json:"ssl_certificate,omitempty"` Auth bool `json:"basic_authenticate,omitempty"` Authenticate Auth `json:"authentication,omitempty"` Libraries []string `json:"libraries,omitempty"` LibraryScan ScanSection `json:"library_scan,omitempty"` LogFile string `json:"log_file,omitempty"` SqliteDatabase string `json:"sqlite_database,omitempty"` Gzip bool `json:"gzip,omitempty"` ReadTimeout int `json:"read_timeout,omitempty"` WriteTimeout int `json:"write_timeout,omitempty"` MaxHeadersSize int `json:"max_header_bytes,omitempty"` DownloadArtwork bool `json:"download_artwork,omitempty"` DiscogsAuthToken string `json:"discogs_auth_token,omitempty"` }
Config contains representation for everything in config.json
type ScanSection ¶ added in v1.0.2
type ScanSection struct { Disable bool `json:"disable,omitempty"` FilesPerOperation int64 `json:"files_per_operation,omitempty"` SleepPerOperation time.Duration `json:"sleep_after_operation,omitempty"` InitialWait time.Duration `json:"initial_wait_duration,omitempty"` }
ScanSection is used for merging the two configs. Its purpose is to essentially hold the default values for its properties.
func (*ScanSection) UnmarshalJSON ¶ added in v1.0.2
func (ss *ScanSection) UnmarshalJSON(input []byte) error
UnmarshalJSON parses a JSON and populets its ScanSection. Satisfies the Unmrashaller interface.