Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Decoders = map[string]Decoder{ "JSON": { IDs: []string{"json"}, ToJSON: func(content []byte) ([]byte, error) { return content, nil }, }, "YAML": { IDs: []string{"yml", "yaml"}, ToJSON: func(content []byte) (bytes []byte, err error) { var m map[string]interface{} if err = yaml.Unmarshal(content, &m); err != nil { return } return json.Marshal(m) }, }, "TOML": { IDs: []string{"toml"}, ToJSON: func(content []byte) (out []byte, err error) { var m map[string]interface{} if err = toml.Unmarshal(content, &m); err != nil { return } return json.Marshal(m) }, }, }
View Source
var DefaultStorage = Dir("conf")
DefaultStorage default conf storage, from "conf" directory
Functions ¶
Types ¶
type Storage ¶ added in v0.2.0
type Storage interface { // Load load specified configuration into interface, tag 'json' and 'default' are supported Load(name string, out interface{}) error }
Storage configuration storage, could be a local directory, a etcd endpoint or something else
Click to show internal directories.
Click to hide internal directories.