Documentation ¶
Index ¶
- func FromBytes(bytes []byte, target interface{}) error
- func FromJson(jsonStr string, target interface{}) error
- func RegisterFuzzyDecoders()
- func RegisterTimeAsInt64Codec(precision time.Duration)
- func ToBytes(data interface{}) ([]byte, error)
- func ToJson(data interface{}) (string, error)
- type Any
- type Decoder
- type DelayJsoniter
- type Encoder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterFuzzyDecoders ¶ added in v0.0.3
func RegisterFuzzyDecoders()
RegisterFuzzyDecoders 处理字符串和数字自动转换
func RegisterTimeAsInt64Codec ¶
RegisterTimeAsInt64Codec 注册时间类型为 int64
Types ¶
type Any ¶
Any alias to jsoniter.Any
func GetNodeFromBytes ¶
GetNodeFromBytes 通过路径,快速从字节数组解析数据
func GetNodeFromString ¶
GetNodeFromString 通过路径,快速从json字符串解析数据
type DelayJsoniter ¶
type DelayJsoniter struct {
// contains filtered or unexported fields
}
DelayJsoniter 通过重写 string() 方法来延迟执行json序列化
func ToJsonDelay ¶
func ToJsonDelay(data interface{}) *DelayJsoniter
ToJsonDelay 对象转 json 字符串,在调用 String() 方法时才会执行转换方法
func (*DelayJsoniter) String ¶
func (d *DelayJsoniter) String() string
String 返回json字符串,如果失败则返回error信息
Click to show internal directories.
Click to hide internal directories.