jsonutil

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadJSON added in v1.5.1

func LoadJSON[X any](inputPath string) (*X, error)

func WriteJSON added in v1.5.0

func WriteJSON[X any](outputPath string, value X, perm os.FileMode) error

Types

type LazySortedJsonMap

type LazySortedJsonMap[K comparable, V any] map[K]V

LazySortedJsonMap provides sorted encoding order for JSON maps. The sorting is lazy: in-memory it's just a map, until it sorts just-in-time when the map is encoded to JSON. Warning: the just-in-time sorting requires a full allocation of the map structure and keys slice during encoding. Sorting order is not enforced when decoding from JSON.

func (LazySortedJsonMap[K, V]) MarshalJSON

func (m LazySortedJsonMap[K, V]) MarshalJSON() ([]byte, error)

func (*LazySortedJsonMap[K, V]) UnmarshalJSON

func (m *LazySortedJsonMap[K, V]) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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