Documentation ¶
Index ¶
- Variables
- func Open(v any, filename string) error
- func OpenFS(v any, fsys fs.FS, filename string) error
- func OpenFiles(v any, filenames ...string) error
- func OpenFilesFS(v any, fsys fs.FS, filenames ...string) error
- func Read(v any, reader io.Reader) error
- func ReadBytes(v any, data []byte) error
- func Save(v any, filename string) error
- func SaveIndent(v any, filename string) error
- func Write(v any, writer io.Writer) error
- func WriteBytes(v any) ([]byte, error)
- func WriteBytesIndent(v any) ([]byte, error)
- func WriteIndent(v any, writer io.Writer) error
Constants ¶
This section is empty.
Variables ¶
View Source
var IndentEncoderFunc = func(w io.Writer) iox.Encoder { e := json.NewEncoder(w) e.SetIndent("", "\t") return e }
IndentEncoderFunc is a iox.EncoderFunc that sets indentation
Functions ¶
func OpenFS ¶
OpenFS reads the given object from the given filename using JSON encoding, using the given fs.FS filesystem (e.g., for embed files)
func OpenFilesFS ¶
OpenFilesFS reads the given object from the given filenames using JSON encoding, using the given fs.FS filesystem (e.g., for embed files)
func SaveIndent ¶
SaveIndent writes the given object to the given filename using JSON encoding, with indentation
func WriteBytes ¶
WriteBytes writes the given object, returning bytes of the encoding, using JSON encoding
func WriteBytesIndent ¶
WriteBytesIndent writes the given object, returning bytes of the encoding, using JSON encoding, with indentation
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.