json

package
v0.0.0-...-5bb4afb Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DateTimeLayout = "2006-01-02 15:04:05"
	DateLayout     = "2006-01-02"
	TimeLayout     = "15:04:05"
)

Variables

This section is empty.

Functions

func DecodeJSONP

func DecodeJSONP(str []byte) []byte

DecodeJSONP 剔除jsonp包裹层

func Marshal

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

Marshal disable html escape

func MustMarshal

func MustMarshal(v interface{}) []byte

MustMarshal must marshal successful

func MustUnmarshal

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

MustUnmarshal must unmarshal successful

func PrettyMarshal

func PrettyMarshal(v interface{}) []byte

PrettyMarshal colorful json

func PrettyMarshalWithIndent

func PrettyMarshalWithIndent(v interface{}) []byte

PrettyMarshalWithIndent colorful json

func Unmarshal

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

Unmarshal same as sys unmarshal

func UnsafeMarshal

func UnsafeMarshal(v interface{}) []byte

UnsafeMarshal marshal without error

func UnsafeMarshalIndent

func UnsafeMarshalIndent(v interface{}) []byte

UnsafeMarshalIndent marshal without error

func UnsafeMarshalString

func UnsafeMarshalString(v interface{}) string

UnsafeMarshalString marshal without error

Types

type Date

type Date time.Time

func (Date) MarshalJSON

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

func (*Date) UnmarshalJSON

func (t *Date) UnmarshalJSON(b []byte) error

type DateTime

type DateTime time.Time

func (DateTime) MarshalJSON

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

func (*DateTime) UnmarshalJSON

func (t *DateTime) UnmarshalJSON(b []byte) error

type RawMessage

type RawMessage = sysjson.RawMessage

type Time

type Time time.Time

func (Time) MarshalJSON

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

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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