Documentation
¶
Index ¶
- func LoadObjectFromFile(filename string, object interface{}) (err error)
- func NewFormattedJSONEncoder(w io.Writer) *json.Encoder
- func SaveNonDefaultValuesToFile(filename string, object, defaultObject interface{}, ignore []string) error
- func SaveObjectToFile(filename string, object interface{}, prettyFormat bool) error
- func WriteNonDefaultValues(writer io.Writer, object, defaultObject interface{}, ignore []string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadObjectFromFile ¶
LoadObjectFromFile implements the common pattern for loading an instance of an object from a json file.
func NewFormattedJSONEncoder ¶
NewFormattedJSONEncoder returns a json encoder configured for pretty-printed output (human-readable)
func SaveNonDefaultValuesToFile ¶
func SaveNonDefaultValuesToFile(filename string, object, defaultObject interface{}, ignore []string) error
SaveNonDefaultValuesToFile saves an object to a file as json, but only fields that are not currently set to be the default value. Optionally, you can specify an array of field names to always include.
func SaveObjectToFile ¶
SaveObjectToFile implements the common pattern for saving an object to a file as json
func WriteNonDefaultValues ¶
func WriteNonDefaultValues(writer io.Writer, object, defaultObject interface{}, ignore []string) error
WriteNonDefaultValues writes object to a writer as json, but only fields that are not currently set to be the default value. Optionally, you can specify an array of field names to always include.
Types ¶
This section is empty.