tomls

package
v0.3.31 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: BSD-3-Clause Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDecoder

func NewDecoder(r io.Reader) grows.Decoder

NewDecoder returns a new Decoder

func Open

func Open(v any, filename string) error

Open reads the given object from the given filename using TOML encoding

func OpenFS

func OpenFS(v any, fsys fs.FS, filename string) error

OpenFS reads the given object from the given filename using TOML encoding, using the given fs.FS filesystem (e.g., for embed files)

func OpenFiles added in v0.3.1

func OpenFiles(v any, filenames []string) error

OpenFiles reads the given object from the given filenames using TOML encoding

func OpenFilesFS added in v0.3.1

func OpenFilesFS(v any, fsys fs.FS, filenames []string) error

OpenFilesFS reads the given object from the given filenames using TOML encoding, using the given fs.FS filesystem (e.g., for embed files)

func OpenFromPaths added in v0.3.20

func OpenFromPaths(obj any, file string, paths []string) error

OpenFromPaths reads object from given TOML file, looking on paths for the file.

func Read

func Read(v any, reader io.Reader) error

Read reads the given object from the given reader, using TOML encoding

func ReadBytes

func ReadBytes(v any, data []byte) error

ReadBytes reads the given object from the given bytes, using TOML encoding

func Save

func Save(v any, filename string) error

Save writes the given object to the given filename using TOML encoding

func Write

func Write(v any, writer io.Writer) error

Write writes the given object using TOML encoding

func WriteBytes

func WriteBytes(v any) ([]byte, error)

WriteBytes writes the given object, returning bytes of the encoding, using TOML encoding

Types

type Decoder

type Decoder struct {
	*toml.Decoder
}

Decoder is needed to return a standard Decode function signature for toml. Just wraps toml.Decoder to satisfy our grows.Decoder interface. Should not need to use in your code.

func (*Decoder) Decode

func (d *Decoder) Decode(v any) error

Decode implements the standard grows.Decoder signature

Jump to

Keyboard shortcuts

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