Documentation
¶
Overview ¶
Package config implements logic to load dynamic configuration from various sources
Index ¶
- func Adapters() []string
- func NewStore(configStoreURI string) (store.Store, error)
- func Register(name string, adapter store.Adapter)
- func TreeWithContext(ctx context.Context, t Tree) context.Context
- func ValueOf(s string) string
- func ValuesOf(v interface{}) interface{}
- type Config
- type Request
- type Tree
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(name string, adapter store.Adapter)
Register makes a store adapter available by the provided name. If an adapter is registered twice or if an adapter is nil, it will panic.
func TreeWithContext ¶
TreeWithContext returns a copy of parent in which the `Tree` is stored
Types ¶
type Config ¶
type Config struct {
Node string `toml:"node"`
Version string `toml:"version"`
Request Request `toml:"request"`
}
Config defines the app config
type Request ¶
type Request struct {
TimeoutMS time.Duration `toml:"timeout_ms"`
AllowContext bool `toml:"allow_context"`
Panic bool `toml:"panic"`
}
Request defines the request default configuration
type Tree ¶
type Tree interface {
Keys() []string
Has(key string) bool
Get(key string) Tree
Unmarshal(v interface{}) error
String() string
}
Tree is a configuration tree
func TreeFromContext ¶
func TreeFromContext(ctx contextutil.ValueContext) Tree
TreeFromContext returns a config `Tree` instance associated with `ctx`, or a `NopTree` if no `Tree` instance could be found.
func TreeFromMap ¶
TreeFromMap initialises a new Tree object using the given map.
Click to show internal directories.
Click to hide internal directories.