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)
- type DummyKeystoreOpts
- type FactoryOpts
- type FileKeystoreOpts
- type InmemKeystoreOpts
- type SwOpts
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.
type DummyKeystoreOpts ¶
type DummyKeystoreOpts struct{}
type FactoryOpts ¶
type FactoryOpts struct { ProviderName string `mapstructure:"default" json:"default" yaml:"Default"` SwOpts *SwOpts `mapstructure:"SW,omitempty" json:"SW,omitempty" yaml:"SwOpts"` }
FactoryOpts holds configuration information used to initialize factory implementations
func GetDefaultOpts ¶
func GetDefaultOpts() *FactoryOpts
GetDefaultOpts offers a default implementation for Opts returns a new instance every time
type FileKeystoreOpts ¶
type FileKeystoreOpts struct {
KeyStorePath string `mapstructure:"keystore" yaml:"KeyStore"`
}
type InmemKeystoreOpts ¶
type InmemKeystoreOpts struct{}
InmemKeystoreOpts - empty, as there is no config for the in-memory keystore
type SwOpts ¶
type SwOpts struct { // Default algorithms when not specified (Deprecated?) SecLevel int `mapstructure:"security" json:"security" yaml:"Security"` HashFamily string `mapstructure:"hash" json:"hash" yaml:"Hash"` // Keystore Options Ephemeral bool `mapstructure:"tempkeys,omitempty" json:"tempkeys,omitempty"` FileKeystore *FileKeystoreOpts `mapstructure:"filekeystore,omitempty" json:"filekeystore,omitempty" yaml:"FileKeyStore"` DummyKeystore *DummyKeystoreOpts `mapstructure:"dummykeystore,omitempty" json:"dummykeystore,omitempty"` InmemKeystore *InmemKeystoreOpts `mapstructure:"inmemkeystore,omitempty" json:"inmemkeystore,omitempty"` }
SwOpts contains options for the SWFactory