Documentation ¶
Index ¶
- func ConfigPaths() []string
- func YamlStringToStructHook(m interface{}) func(rf reflect.Kind, rt reflect.Kind, data interface{}) (interface{}, error)
- type ConfigParser
- func (c *ConfigParser) AddConfigPaths(cfgPaths ...string)
- func (c *ConfigParser) ConfigFileUsed() string
- func (c *ConfigParser) EnhancedExactUnmarshal(output interface{}) error
- func (c *ConfigParser) ReadConfig(in io.Reader) error
- func (c *ConfigParser) ReadInConfig() error
- func (c *ConfigParser) SetConfigName(in string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigPaths ¶
func ConfigPaths() []string
ConfigPaths returns the paths from environment and defaults which are CWD and /etc/hyperledger/fabric.
Types ¶
type ConfigParser ¶
type ConfigParser struct {
// contains filtered or unexported fields
}
ConfigParser holds the configuration file locations. It keeps the config file directory locations and env variables. From the file the config is unmarshalled and stored. Currently "yaml" is supported.
func (*ConfigParser) AddConfigPaths ¶
func (c *ConfigParser) AddConfigPaths(cfgPaths ...string)
AddConfigPaths keeps a list of path to search the relevant config file. Multiple paths can be provided.
func (*ConfigParser) ConfigFileUsed ¶
func (c *ConfigParser) ConfigFileUsed() string
ConfigFileUsed returns the used configFile.
func (*ConfigParser) EnhancedExactUnmarshal ¶
func (c *ConfigParser) EnhancedExactUnmarshal(output interface{}) error
EnhancedExactUnmarshal is intended to unmarshal a config file into a structure producing error when extraneous variables are introduced and supporting the time.Duration type
func (*ConfigParser) ReadConfig ¶
func (c *ConfigParser) ReadConfig(in io.Reader) error
ReadConfig parses the buffer and initializes the config.
func (*ConfigParser) ReadInConfig ¶
func (c *ConfigParser) ReadInConfig() error
ReadInConfig reads and unmarshals the config file.
func (*ConfigParser) SetConfigName ¶
func (c *ConfigParser) SetConfigName(in string)
SetConfigName provides the configuration file name stem. The upper-cased version of this value also serves as the environment variable override prefix.