Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromJSON ¶
func FromJSON(r io.Reader, vrw types.ValueReadWriter, opts FromOptions) (types.Value, error)
func NomsValueFromDecodedJSON ¶
func NomsValueFromDecodedJSON(vrw types.ValueReadWriter, o interface{}, useStruct bool) types.Value
NomsValueFromDecodedJSON takes a generic Go interface{} and recursively tries to resolve the types within so that it can build up and return a Noms Value with the same structure.
Currently, the only types supported are the Go versions of legal JSON types: Primitives:
- float64
- bool
- string
- nil
Composites:
- []interface{}
- map[string]interface{}
Types ¶
type FromOptions ¶
type FromOptions struct { // If true, JSON objects are decoded into Noms Structs. Otherwise, they are decoded into Maps. Structs bool }
FromOptions controls how FromJSON works.
type ToOptions ¶
type ToOptions struct { // Enable support for encoding Noms Lists. Lists are encoded as JSON arrays. Lists bool // Enable support for encoding Noms Maps. Maps are encoded as JSON objects. Maps bool // Enable support for encoding Noms Sets. Sets are encoded as JSON arrays. Sets bool // Enable support for encoding Noms Structs. Structs are encoded as JSON objects. Structs bool // String to use for indent when pretty-printing Indent string }
ToOptions controls how ToJSON works.
Click to show internal directories.
Click to hide internal directories.