json

package
v1.3.40 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ANSIC       = "ANSIC"
	UnixDate    = "UnixDate"
	RubyDate    = "RubyDate"
	RFC822      = "RFC822"
	RFC822Z     = "RFC822Z"
	RFC850      = "RFC850"
	RFC1123     = "RFC1123"
	RFC1123Z    = "RFC1123Z"
	RFC3339     = "RFC3339"
	RFC3339Nano = "RFC3339Nano"
	Kitchen     = "Kitchen"
	Stamp       = "Stamp"
	StampMilli  = "StampMilli"
	StampMicro  = "StampMicro"
	StampNano   = "StampNano"
	ShangHai    = "ShangHai"
)

time format alias

View Source
const (
	Local = "Local"
	UTC   = "UTC"
)

time zone alias

Variables

View Source
var CustomTimeFormat = jsoniter.ConfigCompatibleWithStandardLibrary

Functions

func AddLocaleAlias

func AddLocaleAlias(alias string, locale *time.Location)

func AddTimeFormatAlias

func AddTimeFormatAlias(alias, format string)

func Marshal

func Marshal(v interface{}) ([]byte, error)

func SetDefaultTimeFormat

func SetDefaultTimeFormat(timeFormat string, timeLocation *time.Location)

func Unmarshal

func Unmarshal(data []byte, v interface{}) error

Types

type CustomTimeExtension

type CustomTimeExtension struct {
	jsoniter.DummyExtension
}

func (*CustomTimeExtension) UpdateStructDescriptor

func (extension *CustomTimeExtension) UpdateStructDescriptor(structDescriptor *jsoniter.StructDescriptor)

type Time added in v1.1.5

type Time time.Time

func (Time) MarshalJSON added in v1.1.5

func (t Time) MarshalJSON() ([]byte, error)

MarshalJSON implements json marshal interface.

func (*Time) Scan added in v1.1.5

func (t *Time) Scan(v interface{}) error

func (Time) String added in v1.1.5

func (t Time) String() string

func (*Time) UnmarshalJSON added in v1.1.5

func (t *Time) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON implements json unmarshal interface.

func (Time) Value added in v1.1.5

func (t Time) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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