Documentation
¶
Index ¶
- Constants
- func AddConfigPath(v *viper.Viper, p string)
- func Join(components ...string) string
- func TranslatePath(base, p string) string
- type DecodeHookFuncType
- type MergeConfigEvent
- type OnMergeConfigEventHandler
- type Provider
- func (p *Provider) AddDecodeHook(f DecodeHookFuncType) error
- func (p *Provider) ConfigFileUsed() string
- func (p *Provider) GetBool(key string) bool
- func (p *Provider) GetDuration(key string) time.Duration
- func (p *Provider) GetInt(key string) int
- func (p *Provider) GetPath(key string) string
- func (p *Provider) GetString(key string) string
- func (p *Provider) GetStringSlice(key string) []string
- func (p *Provider) ID() string
- func (p *Provider) IsSet(key string) bool
- func (p *Provider) MergeConfig(raw []byte) error
- func (p *Provider) OnMergeConfig(handler OnMergeConfigEventHandler)
- func (p *Provider) ProvideFromRaw(raw []byte) (*Provider, error)
- func (p *Provider) TranslatePath(path string) string
- func (p *Provider) UnmarshalKey(key string, rawVal interface{}) error
Constants ¶
View Source
const ( CmdRoot = "core" // IDKey is the key to retrieve the FSC id IDKey = "fsc.id" )
View Source
const ( OfficialPath = "/etc/hyperledger-labs/fabric-smart-client-node" MergeConfigEventTopic = "fsc.mergeConfig.event.topic" )
Variables ¶
This section is empty.
Functions ¶
func AddConfigPath ¶
func Join ¶ added in v0.5.1
Join joins multiple string components with a dot (.). It also trims leading/trailing dots from each component to ensure clean joining.
func TranslatePath ¶
Types ¶
type DecodeHookFuncType ¶
type MergeConfigEvent ¶
type MergeConfigEvent struct {
}
func (*MergeConfigEvent) Message ¶
func (m *MergeConfigEvent) Message() interface{}
func (*MergeConfigEvent) Topic ¶
func (m *MergeConfigEvent) Topic() string
type OnMergeConfigEventHandler ¶
type OnMergeConfigEventHandler interface {
OnMergeConfig()
}
type Provider ¶
func GetProvider ¶
GetProvider returns an instance of the config service. It panics, if no instance is found.
func NewProvider ¶
func (*Provider) AddDecodeHook ¶
func (p *Provider) AddDecodeHook(f DecodeHookFuncType) error
func (*Provider) ConfigFileUsed ¶
func (*Provider) GetStringSlice ¶
func (*Provider) MergeConfig ¶
func (*Provider) OnMergeConfig ¶
func (p *Provider) OnMergeConfig(handler OnMergeConfigEventHandler)
func (*Provider) ProvideFromRaw ¶ added in v0.5.1
ProvideFromRaw returns a new Provider whose configuration is loaded from the given byte representation. The function expects a valid `yaml` representation. The new provider inherit the same config file used by this provider.
func (*Provider) TranslatePath ¶
func (*Provider) UnmarshalKey ¶
Click to show internal directories.
Click to hide internal directories.