Documentation ¶
Overview ¶
Package jsontypes supports decoding for interface types whose concrete implementations need to be stored as JSON. To do this, concrete values are packaged in wrapper objects having the form:
{ "type": "<type-tag>", "value": <json-encoding-of-value> }
This package provides a registry for type tag strings and functions to encode and decode wrapper objects.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Marshal ¶
Marshal marshals a JSON wrapper object containing v. If v == nil, Marshal returns the JSON "null" value without error.
func MustRegister ¶
func MustRegister(v Tagged)
MustRegister adds v to the type registry. It will panic if the tag returned by v is already registered. This function is meant for use during program initialization.
Types ¶
Click to show internal directories.
Click to hide internal directories.