Documentation ¶
Index ¶
- func DecodeJSON(f io.Reader, v interface{}) error
- func DecodeYAML(f io.Reader, v interface{}) error
- func EncodeJSON(f io.Writer, v interface{}) error
- func EncodeYAML(f io.Writer, v interface{}) error
- func ExportConfig(configfile string, config *viper.Viper) error
- func ImportConfig(configfile string) (*viper.Viper, error)
- func ReadConfig(dec decoder, path string, conf interface{}) error
- func ReadJSONConfig(path string, conf interface{}) error
- func ReadYAMLConfig(path string, conf interface{}) error
- func WriteConfig(enc encoder, path string, conf interface{}) error
- func WriteJSONConfig(path string, conf interface{}) error
- func WriteTemplate(path string, tpl *template.Template, conf interface{}) error
- func WriteYAMLConfig(path string, conf interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeJSON ¶
DecodeJSON decodes object from reader
func DecodeYAML ¶
DecodeYAML decodes object from reader
func EncodeJSON ¶
EncodeJSON encodes object to writer
func EncodeYAML ¶
EncodeYAML encodes object to writer
func ExportConfig ¶
ExportConfig converts a viper to a file on disk
func ImportConfig ¶
ImportConfig converts a configuration file to a viper
func ReadConfig ¶
ReadConfig decodes an object from the specified file
func ReadJSONConfig ¶
ReadJSONConfig unmarshals a JSON encoded object from the specified file
func ReadYAMLConfig ¶
ReadYAMLConfig unmarshals a YAML encoded object from the specified file
func WriteConfig ¶
WriteConfig encodes an object to the specified file
func WriteJSONConfig ¶
WriteJSONConfig marshals from an interface to json and writes the result to the path indicated
func WriteTemplate ¶
WriteTemplate applies a config to a Template and writes the result to the path indicated
func WriteYAMLConfig ¶
WriteYAMLConfig marshals from an interface to yaml and writes the result to the path indicated
Types ¶
This section is empty.