json

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: Apache-2.0 Imports: 7 Imported by: 74

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