decode

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTagName = "default"

DefaultTagName specifies the struct tag used to identify default value for the field

Variables

This section is empty.

Functions

func Decode

func Decode(m map[string]interface{}, discriminator string, f Factory) (interface{}, error)

Decode a map into a Decodeable thing given the discriminator and the factory for all possible types and embedded types

func DecodeInto added in v0.0.10

func DecodeInto(m map[string]interface{}, o interface{}, pf PathFactory) (interface{}, error)

func DecodeIntoWithDefaults added in v0.1.5

func DecodeIntoWithDefaults(m map[string]interface{}, o interface{}, pf PathFactory, applyDefaults bool) (interface{}, error)

func UnmarshalJSON

func UnmarshalJSON(b []byte, discriminator string, f Factory) (interface{}, error)

UnmarshalJSON byte description of a Decodeable thing

func UnmarshalJSONInto added in v0.0.10

func UnmarshalJSONInto(b []byte, o interface{}, pf PathFactory) (interface{}, error)

UnmarshalJSON byte into an instance of object

func UnmarshalJSONIntoWithDefaults added in v0.1.5

func UnmarshalJSONIntoWithDefaults(b []byte, o interface{}, pf PathFactory, applyDefaults bool) (interface{}, error)

UnmarshalJSON byte into an instance of object

Types

type Factory

type Factory func(kind string) (interface{}, error)

Factory makes Decodeable things described by their kind

type OneOfFactory added in v0.0.10

type OneOfFactory func(map[string]interface{}) (interface{}, error)

Factory makes Decodeable things described by their kind

type PathFactory added in v0.0.10

type PathFactory func(path string) (func(map[string]interface{}) (interface{}, error), error)

PathFactory returns a Factory

Jump to

Keyboard shortcuts

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