Documentation
¶
Index ¶
- func LoadJSON(r io.Reader, out interface{}) error
- func LoadJSONFile(path string, out interface{}) error
- func LoadTOML(r io.Reader, out interface{}) error
- func LoadTOMLFile(path string, out interface{}) error
- func LoadYAML(r io.Reader, out interface{}) error
- func LoadYAMLFile(path string, out interface{}) error
- func MustLoadJSONFile(path string, out interface{})
- func MustLoadTOMLFile(path string, out interface{})
- func MustLoadYAMLFile(path string, out interface{})
- type JSONLoader
- type Loader
- type TOMLLoader
- type YAMLLoader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadJSONFile ¶
LoadJSONFile calls jsoncfg.LoadFile.
func LoadTOMLFile ¶ added in v0.2.0
func LoadYAMLFile ¶
LoadYAMLFile decodes YAML file into out.
func MustLoadJSONFile ¶
func MustLoadJSONFile(path string, out interface{})
MustLoadJSONFile calls jsoncfg.MustLoadFile.
func MustLoadTOMLFile ¶ added in v0.2.0
func MustLoadTOMLFile(path string, out interface{})
func MustLoadYAMLFile ¶
func MustLoadYAMLFile(path string, out interface{})
MustLoadYAMLFile is like LoadYAMLFile but panics on error.
Types ¶
type JSONLoader ¶
JSONLoader is kept for backwards-compatibility. It aliases jsoncfg.Loader.
type Loader ¶
type Loader interface { // Load decodes configuration data read from r into the value pointed to by // out. Load(r io.Reader, out interface{}) error // LoadFile opens the file located at path and delegates to Load. LoadFile(path string, out interface{}) error }
Loader defines the common behaviour for all configuration loaders (JSON, YAML, TOML, ENV, etc.). Implementations should be stateless so that they are safe for concurrent use.
Callers typically use the convenience helpers in each format sub-package rather than interact with Loader directly.
type TOMLLoader ¶ added in v0.2.0
type YAMLLoader ¶
YAMLLoader aliases yamlcfg.Loader for convenience.
Click to show internal directories.
Click to hide internal directories.