Documentation ¶
Index ¶
- Constants
- func AddDevConfigPath(v *viper.Viper) error
- func GetDevConfigDir() (string, error)
- func GetDevMspDir() (string, error)
- func GetPath(key string) string
- func InitViper(v *viper.Viper, configName string) error
- func TranslatePath(base, p string) string
- func TranslatePathInPlace(base string, p *string)
Constants ¶
const OfficialPath = "/etc/hyperledger/fabric"
Variables ¶
This section is empty.
Functions ¶
func AddDevConfigPath ¶
---------------------------------------------------------------------------------- AddDevConfigPath() ---------------------------------------------------------------------------------- Helper utility that automatically adds our DevConfigDir to the viper path ----------------------------------------------------------------------------------
func GetDevConfigDir ¶
---------------------------------------------------------------------------------- GetDevConfigDir() ---------------------------------------------------------------------------------- Returns the path to the default configuration that is maintained with the source tree. Only valid to call from a test/development context. ----------------------------------------------------------------------------------
func GetDevMspDir ¶
---------------------------------------------------------------------------------- GetDevMspDir() ---------------------------------------------------------------------------------- Builds upon GetDevConfigDir to return the path to our sampleconfig/msp that is maintained with the source tree. Only valid to call from a test/development context. Runtime environment should use configuration elements such as
GetPath("peer.mspConfigDir")
----------------------------------------------------------------------------------
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 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 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.