jsoncfg

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(path string, v any) error

Open 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 implements encoding.TextMarshaler and encoding.TextUnmarshaler.

func (Duration) MarshalText

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

MarshalText implements encoding.TextMarshaler.MarshalText.

func (*Duration) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.UnmarshalText.

func (Duration) Value

func (d Duration) Value() time.Duration

Value returns the duration as time.Duration.

Jump to

Keyboard shortcuts

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