Documentation ¶
Index ¶
- func MarshalJSON(anyObject interface{}) string
- func MarshalPrettyJSON(anyObject interface{}) string
- func UnmarshalToJson(v interface{}) *sjson.Json
- type Bytes16
- type IP
- type JsonExt
- func (j *JsonExt) CheckGetExt(key string) (*JsonExt, bool)
- func (j *JsonExt) GetExt(key string) *JsonExt
- func (j *JsonExt) GetIndexExt(index int) *JsonExt
- func (j *JsonExt) GetPathExt(branch ...string) *JsonExt
- func (j *JsonExt) IsNil() bool
- func (j *JsonExt) MustInt16() int16
- func (j *JsonExt) MustInt32() int32
- func (j *JsonExt) MustInt8() int8
- func (j *JsonExt) MustStringPtr() *string
- func (j *JsonExt) MustUint16() uint16
- func (j *JsonExt) MustUint32() uint32
- func (j *JsonExt) MustUint8() uint8
- type JsonString
- type JsonTime
- type RawJsonForm
- type SimpleJsonMarshaler
- type SimpleJsonUnmarshaler
- type Uuid
- type VarBytes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalJSON ¶
func MarshalJSON(anyObject interface{}) string
Gets the JSON
This method would panic if the JSON cannot be marshalled
func MarshalPrettyJSON ¶
func MarshalPrettyJSON(anyObject interface{}) string
Gets the JSON(pretty)
This method would panic if the JSON cannot be marshalled
func UnmarshalToJson ¶
Types ¶
type Bytes16 ¶
func (Bytes16) MarshalJSON ¶
For empty bytes, the value of base64 would be "AAAAAAAAAAAAAAAAAAAAAA=="
func (*Bytes16) UnmarshalJSON ¶
For empty string or "null" of JSON, the value of byte array[16] would be [16]byte{}
type IP ¶
This type of time would be serialized to UNIX time for MarshalJSON()
func (IP) MarshalJSON ¶
func (*IP) UnmarshalJSON ¶
UnmarshalJSON parses the JSON-encoded IP string
type JsonExt ¶
func UnmarshalToJsonExt ¶
func UnmarshalToJsonExt(v interface{}) *JsonExt
func (*JsonExt) GetIndexExt ¶
func (*JsonExt) GetPathExt ¶
func (*JsonExt) MustStringPtr ¶
func (*JsonExt) MustUint16 ¶
func (*JsonExt) MustUint32 ¶
type JsonString ¶
type JsonString string
When marshalling, the empty string would be "null" in JSON format
func (JsonString) MarshalJSON ¶
func (s JsonString) MarshalJSON() ([]byte, error)
type JsonTime ¶
This type of time would be serialized to UNIX time for MarshalJSON()
func (JsonTime) MarshalJSON ¶
MarshalJSON does the serialization of UNIX timestamp
func (*JsonTime) UnmarshalJSON ¶
UnmarshalJSON does the deserialization of UNIX timestamp
type RawJsonForm ¶
type RawJsonForm string
When marshalling, the string would be the raw form of JSON format
func (RawJsonForm) MarshalJSON ¶
func (s RawJsonForm) MarshalJSON() ([]byte, error)
type SimpleJsonMarshaler ¶
type SimpleJsonUnmarshaler ¶
type Uuid ¶
func (Uuid) MarshalJSON ¶
For uuid.Nil, the JSON value would be "null"
func (*Uuid) UnmarshalJSON ¶
For empty string or "null" value, the value of uuid would be uuid.Nil
type VarBytes ¶
func (*VarBytes) MarshalJSON ¶
For nil slice and empty slice, the value of JSON would be "null"
func (*VarBytes) UnmarshalJSON ¶
For empty string or "null" of JSON, the value of byte slice would be []byte(nil)