jsoncfg

package
v0.0.0-...-2c4b9c7 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(path string, v any) error

Load opens the JSON file at path and decodes it into v.

Unknown fields in the JSON file will cause an error.

func Save

func Save(path string, v any) error

Save encodes v into JSON and saves it to the file at path.

Types

type Duration

type Duration time.Duration

Duration is time.Duration but uses its string representation for marshaling and unmarshaling.

func (Duration) AppendText

func (d Duration) AppendText(b []byte) ([]byte, error)

AppendText implements encoding.TextAppender.

func (Duration) MarshalText

func (d Duration) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (Duration) Value

func (d Duration) Value() time.Duration

Value returns the duration as a time.Duration.

type FileMode

type FileMode fs.FileMode

FileMode represents fs.FileMode as an octal number in a string.

func (FileMode) AppendText

func (m FileMode) AppendText(b []byte) ([]byte, error)

AppendText implements encoding.TextAppender.

func (FileMode) MarshalText

func (m FileMode) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*FileMode) UnmarshalText

func (m *FileMode) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (FileMode) Value

func (m FileMode) Value() fs.FileMode

Value returns the file mode as fs.FileMode.

Jump to

Keyboard shortcuts

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