Documentation
¶
Index ¶
- func ByteSizeDecodeHook(f, t reflect.Type, data any) (any, error)
- func ConfigPaths() []string
- func GetStringData(dataType reflect.Type, rawData any) (stringData string, isStringData bool)
- func OrdererEndpointDecoder(dataType, targetType reflect.Type, rawData any) (result any, err error)
- func StringSliceViaEnvDecodeHook(f, t reflect.Type, data any) (any, 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 ByteSizeDecodeHook ¶
ByteSizeDecodeHook is a decoder that can parse byte size encodings.
func ConfigPaths ¶
func ConfigPaths() []string
ConfigPaths returns the paths from environment and defaults which are CWD and /etc/hyperledger/fabric.
func GetStringData ¶
GetStringData tries to convert the raw type to string.
func OrdererEndpointDecoder ¶
OrdererEndpointDecoder is a decoder that can parse orderer endpoint.
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.