convert

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes2str

func Bytes2str(b []byte) (s string)

func BytesToInt

func BytesToInt(b []byte) int

func Int64ToString

func Int64ToString(i int64) string

func IntToBytes

func IntToBytes(n int) []byte

func IntToString

func IntToString(i int) string

func JsonToMap

func JsonToMap(body []byte) (*map[string]interface{}, error)

* * @Description: use https://github.com/bytedance/sonic library to json Decode * @param: body * @return: *map[string]interface{} * @return: error * @Author: Iori *

func JsonToMapByInt

func JsonToMapByInt(body []byte, dst *map[string]interface{}) error

* * @Description: json 转 map interface , 数值为int64版本 * @param: jsStr * @return: map[string]interface{} * @return: error * @Author: Iori *

func JsonToMapUseInt64

func JsonToMapUseInt64(body []byte, dst *map[string]interface{}) error

* * @Description: json 转 map interface , 数值使用https://github.com/bytedance/sonic int64版本 * @param: body * @param: dst * @return: error * @Author: Iori *

func JsonToMapUseNumber

func JsonToMapUseNumber(body []byte, dst *map[string]interface{}) error

* * @Description: json 转 map interface , 数值使用https://github.com/bytedance/sonic number 版本 * @param: body * @param: dst * @return: error * @Author: Iori *

func JsonToStruct

func JsonToStruct(jsStr string, st interface{}) error

* * @Description: json to st use https://github.com/bytedance/sonic library * @param: jsStr * @param: st * @return: error * @Author: Iori *

func MapToJson

func MapToJson(hashmap interface{}) string

* * @Description: use https://github.com/bytedance/sonic library to json Encode * @param: hashmap * @return: string * @Author: Iori *

func Str2bytes

func Str2bytes(s string) (b []byte)

func StrToInt

func StrToInt(num string) int

func StrToInt32

func StrToInt32(num string) int32

func StructToJson

func StructToJson(st interface{}) []byte

* * @Description: st to json use https://github.com/bytedance/sonic library * @param: st_ * @return: []byte *

func StructToJsonStr

func StructToJsonStr(st interface{}) string

* * @Description: st to json str use https://github.com/bytedance/sonic library * @param: st * @return: string *

Types

This section is empty.

Jump to

Keyboard shortcuts

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