djson

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bind

func Bind(src []byte, t interface{}) error

func BindFromMap

func BindFromMap(src map[string]interface{}, t interface{}) error

func BindFromString

func BindFromString(src string, t interface{}) error

func Dump

func Dump(t interface{}) []byte

func DumpMap

func DumpMap(t interface{}) map[string]interface{}

func DumpMapWithoutKeys

func DumpMapWithoutKeys(t interface{}, without ...string) map[string]interface{}

func DumpString

func DumpString(t interface{}) string

func FormatDumpString

func FormatDumpString(t interface{}) string

func MustBind

func MustBind(src []byte, t interface{})

func MustBindFromString

func MustBindFromString(src string, t interface{})

Types

type Encoder

type Encoder struct {
}

func NewEncoder

func NewEncoder() *Encoder

func (Encoder) Decode

func (e Encoder) Decode(d []byte, value interface{}) error

func (Encoder) DecodeString

func (e Encoder) DecodeString(d string, value interface{}) error

func (Encoder) Encode

func (e Encoder) Encode(value interface{}) []byte

func (Encoder) EncodeString

func (e Encoder) EncodeString(value interface{}) string

type JsonString

type JsonString json.RawMessage

func (JsonString) MarshalJSON

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

MarshalJSON returns m as the JSON encoding of m.

func (*JsonString) Scan

func (t *JsonString) Scan(value interface{}) error

func (*JsonString) UnmarshalJSON

func (t *JsonString) UnmarshalJSON(data []byte) error

UnmarshalJSON sets *m to a copy of data.

func (JsonString) Value

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

type Raw

type Raw = json.RawMessage

Jump to

Keyboard shortcuts

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