Documentation
¶
Index ¶
- Constants
- func ConfigFilePath() (string, error)
- func EnvValue(spec SettingSpec) (string, bool)
- func RefreshTokenFromEnv() string
- func SetConfigValue(path, alias string, value parser.Value) error
- func SetFilePathForTest(configPath string) func()
- func UnsetConfigValue(path, alias string) (bool, error)
- func ValidSettingAliases() []string
- func WritePrivateFile(path string, body []byte) error
- type RuntimeConfig
- type SettingSpec
- type SettingValue
- type SettingsState
Constants ¶
View Source
const ( DefaultDownloadPath = "./downloads" DefaultFilenameTemplate = "{author} - {title}_{id}" )
View Source
const DefaultConfigFileMode = constants.PrivateFileMode
Variables ¶
This section is empty.
Functions ¶
func ConfigFilePath ¶
func EnvValue ¶
func EnvValue(spec SettingSpec) (string, bool)
func RefreshTokenFromEnv ¶
func RefreshTokenFromEnv() string
func SetFilePathForTest ¶
func SetFilePathForTest(configPath string) func()
func UnsetConfigValue ¶
func ValidSettingAliases ¶
func ValidSettingAliases() []string
func WritePrivateFile ¶
Types ¶
type RuntimeConfig ¶
type SettingSpec ¶
type SettingSpec struct {
Alias string
KoanfKey string
Table []string
Key string
Kind settingKind
HasDefault bool
Default any
}
func SettingSpecByAlias ¶
func SettingSpecByAlias(alias string) (SettingSpec, bool)
type SettingValue ¶
func ParseSettingInput ¶
func ParseSettingInput(alias, raw string) (SettingValue, parser.Value, error)
type SettingsState ¶
type SettingsState struct {
// contains filtered or unexported fields
}
func LoadSettingsState ¶
func LoadSettingsState() (SettingsState, error)
func (SettingsState) Effective ¶
func (s SettingsState) Effective(alias string) (SettingValue, error)
func (SettingsState) Runtime ¶
func (s SettingsState) Runtime() (RuntimeConfig, error)
Click to show internal directories.
Click to hide internal directories.