files

package
v1.32.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeJSON

func DecodeJSON(f io.Reader, v interface{}) error

DecodeJSON decodes object from reader

func DecodeYAML

func DecodeYAML(f io.Reader, v interface{}) error

DecodeYAML decodes object from reader

func EncodeJSON

func EncodeJSON(f io.Writer, v interface{}) error

EncodeJSON encodes object to writer

func EncodeYAML

func EncodeYAML(f io.Writer, v interface{}) error

EncodeYAML encodes object to writer

func ExportConfig

func ExportConfig(configfile string, config *viper.Viper) error

ExportConfig converts a viper to a file on disk

func ReadConfig

func ReadConfig(dec decoder, path string, conf interface{}) error

ReadConfig decodes an object from the specified file

func ReadJSONConfig

func ReadJSONConfig(path string, conf interface{}) error

ReadJSONConfig unmarshals a JSON encoded object from the specified file

func ReadYAMLConfig

func ReadYAMLConfig(path string, conf interface{}) error

ReadYAMLConfig unmarshals a YAML encoded object from the specified file

func WriteConfig

func WriteConfig(enc encoder, path string, conf interface{}) error

WriteConfig encodes an object to the specified file

func WriteJSONConfig

func WriteJSONConfig(path string, conf interface{}) error

WriteJSONConfig marshals from an interface to json and writes the result to the path indicated

func WriteTemplate

func WriteTemplate(path string, tpl *template.Template, conf interface{}) error

WriteTemplate applies a config to a Template and writes the result to the path indicated

func WriteYAMLConfig

func WriteYAMLConfig(path string, conf interface{}) error

WriteYAMLConfig marshals from an interface to yaml and writes the result to the path indicated

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL