Documentation
¶
Overview ¶
Package config provides a unified API for fetching asdf config. Either from the asdfrc file or environment variables.
Index ¶
- type Config
- func (c *Config) AlwaysKeepDownload() (bool, error)
- func (c *Config) Concurrency() (string, error)
- func (c *Config) DisablePluginShortNameRepository() (bool, error)
- func (c *Config) GetHook(hook string) (string, error)
- func (c *Config) LegacyVersionFile() (bool, error)
- func (c *Config) PluginRepositoryLastCheckDuration() (PluginRepoCheckDuration, error)
- type PluginRepoCheckDuration
- type Settings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Home string
ConfigFile string `env:"ASDF_CONFIG_FILE, overwrite"`
DefaultToolVersionsFilename string `env:"ASDF_DEFAULT_TOOL_VERSIONS_FILENAME, overwrite"`
// Unclear if this value will be needed with the golang implementation.
// AsdfDir string
DataDir string `env:"ASDF_DATA_DIR, overwrite"`
// Field that stores the settings struct if it is loaded
Settings Settings
PluginIndexURL string
}
Config is the primary value this package builds and returns
func LoadConfig ¶
LoadConfig builds the Config struct from environment variables
func (*Config) AlwaysKeepDownload ¶
AlwaysKeepDownload loads the asdfrc if it isn't already loaded and fetches the keep downloads boolean flag
func (*Config) Concurrency ¶
Concurrency returns concurrency setting from asdfrc file
func (*Config) DisablePluginShortNameRepository ¶
DisablePluginShortNameRepository loads the asdfrc if it isn't already loaded and fetches the disable plugin short name repo flag
func (*Config) LegacyVersionFile ¶
LegacyVersionFile loads the asdfrc if it isn't already loaded and fetches the legacy version file support flag
func (*Config) PluginRepositoryLastCheckDuration ¶
func (c *Config) PluginRepositoryLastCheckDuration() (PluginRepoCheckDuration, error)
PluginRepositoryLastCheckDuration loads the asdfrc if it isn't already loaded and fetches the keep boolean flag
type PluginRepoCheckDuration ¶
PluginRepoCheckDuration represents the remote plugin repo check duration
* (never or every N seconds). It's not clear to me how this should be * represented in Golang so using a struct for maximum flexibility.
type Settings ¶
type Settings struct {
Loaded bool
Raw *ini.Section
LegacyVersionFile bool
// I don't think this setting should be supported in the Golang implementation
// UseReleaseCandidates bool
AlwaysKeepDownload bool
PluginRepositoryLastCheckDuration PluginRepoCheckDuration
DisablePluginShortNameRepository bool
Concurrency string
}
Settings is a struct that stores config values from the asdfrc file