config

package module
v0.0.0-...-ce39f13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2021 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSubConfiguration

func CreateSubConfiguration(mainConfiguration *ConfigurationProvider, subConfigHierarchy string, configuration interface{}) (err error)

CreateSubConfiguration Create new configuration object for each resource, based on it's values in the main configuration file

Types

type ConfigurationProvider

type ConfigurationProvider struct {
	// contains filtered or unexported fields
}

ConfigurationProvider stores all configurations of the application The values are read by Viper from a config file or from environment variables

func LoadConfig

func LoadConfig(configurationFile string) (config *ConfigurationProvider, err error)

LoadConfig return a new configuration object. The object contains configuration values the were read from a config file and from env variables (if needed)

func (*ConfigurationProvider) AllSettings

func (config *ConfigurationProvider) AllSettings() map[string]interface{}

AllSettings merges all settings and returns them as a map[string]interface{} A wrapper method for viper.AllSettings method

func (*ConfigurationProvider) SubConfig

func (config *ConfigurationProvider) SubConfig(key string) (newConfig *ConfigurationProvider)

SubConfig returns new configuration instance representing a sub tree of the given instance. SubConfig is case-insensitive for a key. A wrapper method for viper.Sub method

func (*ConfigurationProvider) Unmarshal

func (config *ConfigurationProvider) Unmarshal(runTimeConfig interface{}) (err error)

Unmarshal config into our runtime config struct A wrapper method for viper.Unmarshal method

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL