codecs

package
v0.0.0-...-76c1feb Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadObjectFromFile

func LoadObjectFromFile(filename string, object interface{}) (err error)

LoadObjectFromFile implements the common pattern for loading an instance of an object from a json file.

func NewFormattedJSONEncoder

func NewFormattedJSONEncoder(w io.Writer) *json.Encoder

NewFormattedJSONEncoder returns a json encoder configured for pretty-printed output (human-readable)

func SaveNonDefaultValuesToFile

func SaveNonDefaultValuesToFile(filename string, object, defaultObject interface{}, ignore []string, prettyFormat bool) 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

func SaveObjectToFile(filename string, object interface{}, prettyFormat bool) error

SaveObjectToFile implements the common pattern for saving an object to a file as json

Types

This section is empty.

Jump to

Keyboard shortcuts

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