Documentation ¶
Index ¶
- Constants
- func AddSearchPath(path string)
- func GetPath(key string) string
- func GetSearchPath() []string
- func InitViper(v *viper.Viper, configName string) error
- func InitViperConfig(v *viper.Viper, configName string, configFile string) error
- func TranslatePath(base, p string) string
- func TranslatePathInPlace(base string, p *string)
Constants ¶
const ( EnvGOPATH = "GOPATH" EnvNameCfgPath = "ENV_CFG_PATH" OfficialConfigPath = "/etc/officialconfig" RelativeConfigPath = "./config" )
Variables ¶
This section is empty.
Functions ¶
func AddSearchPath ¶
func AddSearchPath(path string)
func GetPath ¶
---------------------------------------------------------------------------------- GetPath() ---------------------------------------------------------------------------------- GetPath allows configuration strings that specify a (config-file) relative path
For example: Assume our config is located in /etc/hyperledger/fabric/core.yaml with a key "msp.configPath" = "msp/config.yaml".
This function will return:
GetPath("msp.configPath") -> /etc/hyperledger/fabric/msp/config.yaml
----------------------------------------------------------------------------------
func GetSearchPath ¶
func GetSearchPath() []string
func InitViper ¶
---------------------------------------------------------------------------------- InitViper() ---------------------------------------------------------------------------------- Performs basic initialization of our viper-based configuration layer. Primary thrust is to establish the paths that should be consulted to find the configuration we need. If v == nil, we will initialize the global Viper instance ----------------------------------------------------------------------------------
func InitViperConfig ¶
InitViperConfig initializes viper config
func TranslatePath ¶
---------------------------------------------------------------------------------- TranslatePath() ---------------------------------------------------------------------------------- Translates a relative path into a fully qualified path relative to the config file that specified it. Absolute paths are passed unscathed. ----------------------------------------------------------------------------------
func TranslatePathInPlace ¶
---------------------------------------------------------------------------------- TranslatePathInPlace() ---------------------------------------------------------------------------------- Translates a relative path into a fully qualified path in-place (updating the pointer) relative to the config file that specified it. Absolute paths are passed unscathed. ----------------------------------------------------------------------------------
Types ¶
This section is empty.