Documentation
¶
Overview ¶
package cfg implements functionalites for configuration
Index ¶
- type Config
- func (c *Config) GetConfig(dotDelimitedKey string) (conf Config, err error)
- func (c *Config) GetValue(dotDelimitedKey string) interface{}
- func (c *Config) Merge(overrides *Config) error
- func (c *Config) ReadFrom(i interface{}) (err error)
- func (c *Config) ReadFromToml(r io.Reader) (err error)
- func (c *Config) ReadFromTomlBytes(b []byte) (err error)
- func (c *Config) ReadFromTomlFile(file string) (err error)
- func (c *Config) SetKeyValue(dotDelimitedKey string, v interface{})
- func (c *Config) WriteTo(v interface{}) (err error)
- func (c *Config) WriteToKVList(w io.Writer)
- func (c *Config) WriteToToml(w io.Writer) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Note: It is not thread/goroutine safe, and is intended to be used in places where it is goroutine/thread safety
func (*Config) Merge ¶
Merge merges the properties from another Config When merging the properties, the keys are considered as case insensitive. The value for the same key will be overriden
func (*Config) ReadFrom ¶
ReadFrom reads configuration properties i, which pointing to a struct or a map
func (*Config) ReadFromToml ¶
ReadFromToml reads configuration properties in TOML format
func (*Config) ReadFromTomlBytes ¶
ReadFromTomlBytes reads configuration properties from byte array in TOML format
func (*Config) ReadFromTomlFile ¶
ReadFromTomlFile reads configuration properties from a file in TOML format
func (*Config) SetKeyValue ¶
SetKeyValue sets the value of a given key
func (*Config) WriteToKVList ¶
WriteToKVList writes the configuration properties as a dot-delimited-key value list