Documentation
¶
Index ¶
- func Parse[T any](data []byte) (T, error)
- func ParseFromFile[T any](path string) (T, error)
- func Serialize(v any) ([]byte, error)
- func SerializePretty(v any) ([]byte, error)
- func SerializePrettyToFile(path string, v any, fm ...os.FileMode) error
- func SerializeToFile(path string, v any, fm ...os.FileMode) error
- type JSONString
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseFromFile ¶
Reads a JSON file and parses its contents into a value of type T.
func SerializePretty ¶
Serializes with json.MarshalIndent using tabs.
func SerializePrettyToFile ¶
Serializes a value to JSON and writes it to a file with pretty formatting. Defaults to 0644 permissions if not specified.
Types ¶
type JSONString ¶
type JSONString string
JSONString is a semantic marker type for JSON payload strings.
Click to show internal directories.
Click to hide internal directories.