json

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2022 License: Apache-2.0 Imports: 7 Imported by: 316 modules, 290 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeDate

func DecodeDate(i *jx.Decoder) (v time.Time, err error)

func DecodeDateTime

func DecodeDateTime(i *jx.Decoder) (v time.Time, err error)

func DecodeDuration

func DecodeDuration(i *jx.Decoder) (v time.Duration, err error)

func DecodeIP

func DecodeIP(i *jx.Decoder) (v net.IP, err error)

DecodeIP decodes net.IP.

func DecodeTime

func DecodeTime(i *jx.Decoder) (v time.Time, err error)

func DecodeURI

func DecodeURI(i *jx.Decoder) (v url.URL, err error)

DecodeURI decodes url.URL from json.

func DecodeUUID

func DecodeUUID(i *jx.Decoder) (v uuid.UUID, err error)

DecodeUUID decodes UUID from json.

func Encode

func Encode(m Marshaler) []byte

Encode Marshaler to byte slice.

func EncodeDate

func EncodeDate(s *jx.Encoder, v time.Time)

func EncodeDateTime

func EncodeDateTime(s *jx.Encoder, v time.Time)

func EncodeDuration

func EncodeDuration(s *jx.Encoder, v time.Duration)

func EncodeIP

func EncodeIP(s *jx.Encoder, v net.IP)

EncodeIP encodes net.IP.

func EncodeTime

func EncodeTime(s *jx.Encoder, v time.Time)

func EncodeURI

func EncodeURI(s *jx.Encoder, v url.URL)

EncodeURI encodes url.URL to json.

func EncodeUUID

func EncodeUUID(s *jx.Encoder, v uuid.UUID)

EncodeUUID encodes UUID to json.

func Marshal

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

Marshal value to json.

func Unmarshal

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

Unmarshal value from json.

Types

type Marshaler

type Marshaler interface {
	Encode(e *jx.Encoder)
}

Marshaler implements json writing.

type Nullable

type Nullable interface {
	IsNil() bool
}

Nullable can be nil (but defined) or not.

type Resettable

type Resettable interface {
	Reset()
}

Resettable value can be unset.

type Settable

type Settable interface {
	IsSet() bool
}

Settable value can be set (present) or unset (i.e. not provided or undefined).

type Unmarshaler

type Unmarshaler interface {
	Decode(d *jx.Decoder) error
}

Unmarshaler implements json reading.

type Value

type Value interface {
	Marshaler
	Unmarshaler
}

Value represents a json value.

Jump to

Keyboard shortcuts

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