mfj

package module
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2021 License: MIT Imports: 6 Imported by: 1

README

json

json tools

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalStructFactory = &StructFactory{
	Generators:    map[string]JsonUnmarshalObjectGenerate{},
	GeneratorsNil: map[string]JsonUnmarshalObjectGenerate{},
}

Functions

func MarshalIndentMust

func MarshalIndentMust(v interface{}, prefix, indent string) string

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)

func (*StructFactory) Get

func (jsf *StructFactory) Get(name string) (obj interface{}, err *mft.Error)

func (*StructFactory) GetNil

func (jsf *StructFactory) GetNil(name string) (obj interface{}, err *mft.Error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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