jsonx

package
v0.3.37 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MarshalIndent = json2.MarshalIndent
	NewDecoder    = json2.NewDecoder
	NewEncoder    = json2.NewEncoder
	Marshal       = json2.Marshal
	Unmarshal     = json2.Unmarshal
)
View Source
var OmitDefaultAPI = jsoniter.Config{
	SortMapKeys:            true,
	UseNumber:              true,
	CaseSensitive:          true,
	EscapeHTML:             true,
	ValidateJsonRawMessage: true,
}.Froze()

OmitDefaultAPI ...

Functions

func Json

func Json(obj interface{}) string

Json ...

func JsonBytes

func JsonBytes(obj interface{}) []byte

JsonBytes ...

func PrettyJSONBytes

func PrettyJSONBytes(obj interface{}) []byte

PrettyJSONBytes ...

func PrettyJson

func PrettyJson(obj interface{}) string

PrettyJson ...

Types

type Duration

type Duration struct {
	time.Duration
}

func Dur added in v0.3.13

func Dur(dur time.Duration) Duration

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(data []byte) error

type MilliTime

type MilliTime struct {
	time.Time
}

func (MilliTime) GetBSON

func (mt MilliTime) GetBSON() (interface{}, error)

func (MilliTime) MarshalJSON

func (mt MilliTime) MarshalJSON() ([]byte, error)

func (MilliTime) Milli

func (mt MilliTime) Milli() int64

func (*MilliTime) UnmarshalJSON

func (mt *MilliTime) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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