Documentation ¶
Overview ¶
Package config provides types and handling for configuration values used in the application.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Configuration ¶
type Configuration struct { IndentationSize uint PreferredSource string Source string // contains filtered or unexported fields }
Configuration defines the application's configuration structure
func NewFromRuntime ¶
func NewFromRuntime( flags *flag.FlagSet, providerConfigs map[string]registry.Configuration, defaults Configuration, ) (Configuration, error)
NewFromRuntime builds a Configuration by merging values from multiple different sources. It accepts a Configuration containing default values to fill in any empty/blank configuration values found when merging from the different sources.
The merging of values from different sources will take this priority: 1. Command line arguments 2. Environment variables 3. A loaded config file, if available 4. Passed in default values
func (Configuration) FilePath ¶ added in v0.4.0
func (c Configuration) FilePath() string
FilePath returns the path of the file that was loaded for the configuration.
func (Configuration) MarshalJSON ¶
func (c Configuration) MarshalJSON() ([]byte, error)
MarshalJSON defines how the configuration should be JSON marshalled.
func (Configuration) ProviderConfigs ¶
func (c Configuration) ProviderConfigs() []registry.Configuration
ProviderConfigs returns the configurations of the source providers.
func (*Configuration) UnmarshalJSON ¶
func (c *Configuration) UnmarshalJSON(data []byte) error
UnmarshalJSON defines how the configuration should be JSON unmarshalled.