config

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2025 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

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 AddConfigPath(v *viper.Viper, p string)

func Join added in v0.5.1

func Join(components ...string) string

Join joins multiple string components with a dot (.). It also trims leading/trailing dots from each component to ensure clean joining.

func TranslatePath

func TranslatePath(base, p string) string

Types

type DecodeHookFuncType

type DecodeHookFuncType func(reflect.Type, reflect.Type, interface{}) (interface{}, error)

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

type Provider struct {
	Backend *viper.Viper
	// contains filtered or unexported fields
}

func GetProvider

func GetProvider(sp services.Provider) *Provider

GetProvider returns an instance of the config service. It panics, if no instance is found.

func NewProvider

func NewProvider(confPath string) (*Provider, error)

func (*Provider) AddDecodeHook

func (p *Provider) AddDecodeHook(f DecodeHookFuncType) error

func (*Provider) ConfigFileUsed

func (p *Provider) ConfigFileUsed() string

func (*Provider) GetBool

func (p *Provider) GetBool(key string) bool

func (*Provider) GetDuration

func (p *Provider) GetDuration(key string) time.Duration

func (*Provider) GetInt

func (p *Provider) GetInt(key string) int

func (*Provider) GetPath

func (p *Provider) GetPath(key string) string

func (*Provider) GetString

func (p *Provider) GetString(key string) string

func (*Provider) GetStringSlice

func (p *Provider) GetStringSlice(key string) []string

func (*Provider) ID

func (p *Provider) ID() string

func (*Provider) IsSet

func (p *Provider) IsSet(key string) bool

func (*Provider) MergeConfig

func (p *Provider) MergeConfig(raw []byte) error

func (*Provider) OnMergeConfig

func (p *Provider) OnMergeConfig(handler OnMergeConfigEventHandler)

func (*Provider) ProvideFromRaw added in v0.5.1

func (p *Provider) ProvideFromRaw(raw []byte) (*Provider, error)

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 (p *Provider) TranslatePath(path string) string

func (*Provider) UnmarshalKey

func (p *Provider) UnmarshalKey(key string, rawVal interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL