Documentation ¶
Index ¶
- Variables
- func MarshalIndentMust(v interface{}, prefix, indent string) string
- type IStructView
- type JsonInterfaceMarshaller
- type JsonUnmarshalObjectGenerate
- type StructFactory
- func (jsf *StructFactory) Add(name string, generator JsonUnmarshalObjectGenerate)
- func (jsf *StructFactory) AddNil(name string, generator JsonUnmarshalObjectGenerate)
- func (jsf *StructFactory) Get(name string) (obj interface{}, err *mft.Error)
- func (jsf *StructFactory) GetNil(name string) (obj interface{}, err *mft.Error)
Constants ¶
This section is empty.
Variables ¶
View Source
var GlobalStructFactory = &StructFactory{ Generators: map[string]JsonUnmarshalObjectGenerate{}, GeneratorsNil: map[string]JsonUnmarshalObjectGenerate{}, }
Functions ¶
func MarshalIndentMust ¶
Types ¶
type IStructView ¶
type IStructView struct { Type string `json:"_type"` Data json.RawMessage `json:"data"` }
func (IStructView) MarshalEasyJSON ¶
func (v IStructView) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (IStructView) MarshalJSON ¶
func (v IStructView) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*IStructView) UnmarshalEasyJSON ¶
func (v *IStructView) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*IStructView) UnmarshalJSON ¶
func (v *IStructView) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type JsonInterfaceMarshaller ¶
type JsonInterfaceMarshaller interface {
UnmarshalJSONTypeName() string
}
type JsonUnmarshalObjectGenerate ¶
type JsonUnmarshalObjectGenerate func() JsonInterfaceMarshaller
type StructFactory ¶
type StructFactory struct { Generators map[string]JsonUnmarshalObjectGenerate GeneratorsNil map[string]JsonUnmarshalObjectGenerate // contains filtered or unexported fields }
StructFactory generate structs for json unmarshal
func (*StructFactory) Add ¶
func (jsf *StructFactory) Add(name string, generator JsonUnmarshalObjectGenerate)
func (*StructFactory) AddNil ¶
func (jsf *StructFactory) AddNil(name string, generator JsonUnmarshalObjectGenerate)
Click to show internal directories.
Click to hide internal directories.