jsontonoms

package
v0.0.0-...-eb31e87 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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{}

func NomsValueUsingNamedStructsFromDecodedJSON

func NomsValueUsingNamedStructsFromDecodedJSON(vrw types.ValueReadWriter, o interface{}) types.Value

NomsValueUsingNamedStructsFromDecodedJSON performs the same function as NomsValueFromDecodedJson except that it always decodes JSON objects into structs. If the JSON object has a string field name '_name' it uses the value of that field as the name of the Noms struct.

Types

This section is empty.

Jump to

Keyboard shortcuts

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