Documentation ¶
Index ¶
- func Bind(src []byte, t interface{}) error
- func BindFromMap(src map[string]interface{}, t interface{}) error
- func BindFromString(src string, t interface{}) error
- func BindWithValidate(src []byte, t interface{}) error
- func Dump(t interface{}) []byte
- func DumpMap(t interface{}) map[string]interface{}
- func DumpMapWithoutKeys(t interface{}, without ...string) map[string]interface{}
- func DumpString(t interface{}) string
- func FormatDumpString(t interface{}) string
- func MustBind(src []byte, t interface{})
- func MustBindFromString(src string, t interface{})
- func MustParse[T any](src []byte) T
- func MustParsePtr[T any](src []byte) *T
- func Parse[T any](src []byte) (T, error)
- func ParseFromString[T any](src string) (T, error)
- func ParsePtr[T any](src []byte) (*T, error)
- func ParsePtrFromString[T any](src string) (*T, error)
- func ParsePtrWithValidate[T any](src []byte) (*T, error)
- type Encoder
- type JsonString
- type Raw
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindFromMap ¶
BindFromMap 从map绑定到指定对象
func BindFromString ¶
BindFromString 从字符串绑定到指定对象
func BindWithValidate ¶ added in v0.9.0
BindWithValidate 绑定到指定对象,并校验结构体
func DumpMapWithoutKeys ¶
func ParseFromString ¶ added in v0.7.0
ParseFromString 从字符串解析到指定类型
func ParsePtrFromString ¶ added in v0.7.0
ParsePtrFromString 从字符串解析到指定类型的指针
Types ¶
type Encoder ¶
type Encoder struct { }
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
Click to show internal directories.
Click to hide internal directories.