Documentation
¶
Overview ¶
Package config provides config handling for orb.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrUnknownPlugin happens when there's no config factory for the given plugin. ErrUnknownPlugin = errors.New("unknown config given") // ErrNotExistent happens when a config key is not existent. ErrNotExistent = errors.New("no such config key") // ErrTypesDontMatch happens when types don't match during Get[T](). ErrTypesDontMatch = errors.New("config key requested type and actual type don't match") // ErrUnknownScheme happens when you didn't import the plugin for the scheme or the scheme is unknown. ErrUnknownScheme = errors.New("unknown config source scheme") // ErrNoSuchFile happens when theres no file. ErrNoSuchFile = errors.New("no such file or no marshaler found") )
Functions ¶
func Get ¶
Get returns either the value of "key" in "data" or the default value "def". * If types don't match it returns ErrTypesDontMatch. * If key hasn't been found it returns ErrNotExistent as well as the default value "def". * * It supports the following datatypes: * - any non-container (string/float64/uvm.) * - []string slice * - []any slice * - map[string]string * - map[string]any * .
func Read ¶
Read reads urls into []Data where Data is basically map[string]any.
By default it will error out if any of these config URL's fail, but you can ignore errors for a single url by adding "?ignore_error=true".
prependSections is for url's that don't support sections (cli for example), theier result will be prepended, also you can add sections to a single url with "?add_section=true".
Types ¶
This section is empty.
Directories
¶
Path | Synopsis |
---|---|
Package marshaler contains a basic interface for marshalers.
|
Package marshaler contains a basic interface for marshalers. |
Package source is a base for all config sources.
|
Package source is a base for all config sources. |
cli
Package cli is the Cli component of orb.
|
Package cli is the Cli component of orb. |
util
|
|
container
Package container contains generic containers.
|
Package container contains generic containers. |