Documentation ¶
Index ¶
- func Deserialize(json []byte, resource *prop.Resource) error
- func DeserializeProperty(json []byte, property prop.Property, allowElementForArray bool) error
- func Options() *options
- func Serialize(resource *prop.Resource, options *options) ([]byte, error)
- func Valid(data []byte) bool
- type ResourceMarshalAdapter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Deserialize ¶
Entry point of JSON deserialization. Unmarshal the JSON input bytes into the unassigned structure of resource.
func DeserializeProperty ¶
Entry point to deserialize a piece of JSON data into the given property. The JSON data is expected to be the content of a json.RawMessage parsed from the built-in encoding/json mechanism, hence, it should not contain any preceding spaces, and should a fragment of valid JSON. The allowElementForArray option is provided to allow JSON array element values be provided for a multiValued property so that it will be de-serialized as its element. The result will be a multiValued property containing a single element.
Types ¶
type ResourceMarshalAdapter ¶
func (ResourceMarshalAdapter) MarshalJSON ¶
func (r ResourceMarshalAdapter) MarshalJSON() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.