Documentation ¶
Index ¶
Constants ¶
const HomeKey = "home"
HomeKey configuration key used for thelma home (path to terra-helmfile clone)
Variables ¶
This section is empty.
Functions ¶
func DefaultConfigFilePath ¶ added in v1.0.41
DefaultConfigFilePath returns the path to the config file within a given Thelma root directory
Types ¶
type Config ¶
type Config interface { // Unmarshal will unmarshal all configuration data under the given prefix into the target struct. // // Unmarshal supports use of annotations from the Validator (https://github.com/go-playground/validator) // and Defaults (https://github.com/mcuadros/go-defaults) libraries in structs. Unmarshal(prefix string, into interface{}) error // Dump returns all config values as a map for debugging purposes Dump() map[string]interface{} // Home returns the fully-qualified path to the local terra-helmfile clone Home() string }
Config is the configuration utility for Thelma. See README.md for usage examples.
func Load ¶ added in v0.0.21
Load Thelma configuration from file, environment, etc into a new Config
func NewTestConfig ¶ added in v0.0.21
NewTestConfig creates an empty config with optional settings, suitable for use unit tests. By default it sets "home" to the OS temp dir, but this be overridden in the settings map. It DOES NOT include any configuration from the environment or config files (~/.thelma/config.yaml)
type Option ¶ added in v0.0.21
type Option func(*Options)
Option can be used to customize default Options struct
func WithOverride ¶ added in v0.0.31
WithOverride merges a single override on top of any that have already been set
func WithOverrides ¶ added in v0.0.31
WithOverrides merges overrides on top of any that have already been set
func WithTestDefaults ¶ added in v0.0.31
WithTestDefaults sets useful test defaults, including: * disabling config loading from config file and environment variables * pointing THELMA_HOME at a temporary directory
func WithThelmaRoot ¶ added in v0.0.29
WithThelmaRoot (FOR TESTING ONLY) sets configuration defaults with paths pointing at a custom Thelma root
type Options ¶ added in v0.0.21
type Options struct { // Overrides overrides to apply to the configuration (useful for testing) Overrides map[string]interface{} // ConfigFile which file to load configuration file from (default ~/.thelma/config.yaml) // Set to "" to skip loading configuration from a file. ConfigFile string // EnvPrefix which prefix to use when loading configuration from environment variables (default "THELMA") // Set to "" to skip loading configuration from environment variables. EnvPrefix string // Profile load a specific configuration profile instead of the one specified by THELMA_CONFIG_PROFILE Profile string }
Options configure the behavior of config.Load(). This interface is provided to support testing only and shouldn't be used during regular program execution.
func DefaultOptions ¶ added in v0.0.21
func DefaultOptions() Options
DefaultOptions returns default options for Config.Load()