Documentation
¶
Index ¶
- func BytesToString(b []byte) string
- func CutLast(key string, n int) string
- func CutString(s, sep string) (found bool, s1, s2 string)
- func FirstWord(key string, n int) string
- func GetBool(v map[string]interface{}, key string) (ret bool, exist bool)
- func GetBytes(v map[string]interface{}, key string) (ret []byte, exist bool)
- func GetFloat64(v map[string]interface{}, key string) (ret float64, exist bool, err error)
- func GetFloat64Array(v map[string]interface{}, key string) ([]float64, bool, error)
- func GetInt(v map[string]interface{}, key string) (ret int, exist bool, err error)
- func GetInt16(v map[string]interface{}, key string) (ret int16, exist bool, err error)
- func GetInt32(v map[string]interface{}, key string) (ret int32, exist bool, err error)
- func GetInt64(v map[string]interface{}, key string) (ret int64, exist bool, err error)
- func GetInt64Array(v map[string]interface{}, key string) ([]int64, bool, error)
- func GetInt8(v map[string]interface{}, key string) (ret int8, exist bool, err error)
- func GetString(v map[string]interface{}, key string) (ret string, exist bool)
- func GetStringArray(v map[string]interface{}, key string) ([]string, bool, error)
- func GetTime(v map[string]interface{}, key, layout string, loc ...*time.Location) (ret time.Time, exist bool, err error)
- func GetUint(v map[string]interface{}, key string) (ret uint, exist bool, err error)
- func GetUint16(v map[string]interface{}, key string) (ret uint16, exist bool, err error)
- func GetUint32(v map[string]interface{}, key string) (ret uint32, exist bool, err error)
- func GetUint64(v map[string]interface{}, key string) (ret uint64, exist bool, err error)
- func GetUint64Array(v map[string]interface{}, key string) ([]uint64, bool, error)
- func GetUint8(v map[string]interface{}, key string) (ret uint8, exist bool, err error)
- func HasBytes(arr []interface{}) bool
- func Interface(v reflect.Value) interface{}
- func InterfaceToArray(value interface{}) (ret []interface{}, err error)
- func InterfaceToBool(value interface{}) bool
- func InterfaceToBytes(value interface{}) []byte
- func InterfaceToFloat64(value interface{}) (float64, error)
- func InterfaceToFloat64Array(value interface{}) (ret []float64, err error)
- func InterfaceToInt(value interface{}) (int, error)
- func InterfaceToInt16(value interface{}) (int16, error)
- func InterfaceToInt32(value interface{}) (int32, error)
- func InterfaceToInt64(value interface{}) (int64, error)
- func InterfaceToInt64Array(value interface{}) (ret []int64, err error)
- func InterfaceToInt8(value interface{}) (int8, error)
- func InterfaceToMap(value interface{}) (map[string]interface{}, error)
- func InterfaceToString(value interface{}) string
- func InterfaceToStringArray(value interface{}) ([]string, error)
- func InterfaceToTime(value interface{}, layout string, loc ...*time.Location) (time.Time, error)
- func InterfaceToUint(value interface{}) (uint, error)
- func InterfaceToUint16(value interface{}) (uint16, error)
- func InterfaceToUint32(value interface{}) (uint32, error)
- func InterfaceToUint64(value interface{}) (uint64, error)
- func InterfaceToUint64Array(value interface{}) (ret []uint64, err error)
- func InterfaceToUint8(value interface{}) (uint8, error)
- func IsArray(v reflect.Value) bool
- func IsEmptyValue(v reflect.Value) bool
- func IsNil(v reflect.Value) bool
- func JoinInt8(s []int8, sep string) string
- func JoinUint64(s []uint64, sep string) string
- func LastWord(key string, n int) string
- func QuickRemoveLFCR(b []byte) string
- func QuickReplaceLFCR(b []byte) string
- func QuickReplaceLFCR2Space(b []byte) string
- func SplitInt(s, sep string) []int
- func SplitInt64(s, sep string) []int64
- func SplitInt8(s, sep string) []int8
- func SplitUint64(s, sep string) []uint64
- func StringToBytes(s string) (b []byte)
- type Map
- func (m Map) GetBool(key string) (ret bool, exist bool)
- func (m Map) GetBytes(key string) (ret []byte, exist bool)
- func (m Map) GetFloat64(key string) (ret float64, exist bool, err error)
- func (m Map) GetFloat64Array(key string) (ret []float64, exist bool, err error)
- func (m Map) GetInt(key string) (int, bool, error)
- func (m Map) GetInt16(key string) (int16, bool, error)
- func (m Map) GetInt32(key string) (int32, bool, error)
- func (m Map) GetInt64(key string) (ret int64, exist bool, err error)
- func (m Map) GetInt64Array(key string) (ret []int64, exist bool, err error)
- func (m Map) GetInt8(key string) (int8, bool, error)
- func (m Map) GetMap(key string) (ret Map, exist bool, err error)
- func (m Map) GetMapArray(key string) (ret []Map, exist bool, err error)
- func (m Map) GetString(key string) (ret string, exist bool)
- func (m Map) GetStringArray(key string) (ret []string, exist bool, err error)
- func (m Map) GetTime(key, layout string, loc ...*time.Location) (ret time.Time, exist bool, err error)
- func (m Map) GetUint(key string) (uint, bool, error)
- func (m Map) GetUint16(key string) (uint16, bool, error)
- func (m Map) GetUint32(key string) (uint32, bool, error)
- func (m Map) GetUint64(key string) (ret uint64, exist bool, err error)
- func (m Map) GetUint64Array(key string) (ret []uint64, exist bool, err error)
- func (m Map) GetUint8(key string) (uint8, bool, error)
- func (m Map) Set(key string, value interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToString ¶
BytesToString converts byte slice to a string without memory allocation.
Note it may break if the implementation of string or slice header changes in the future go versions.
func GetFloat64 ¶
func GetFloat64Array ¶
func GetInt64Array ¶
func GetStringArray ¶
func GetUint64Array ¶
func InterfaceToArray ¶
func InterfaceToArray(value interface{}) (ret []interface{}, err error)
InterfaceToArray 接口转数组
func InterfaceToBool ¶
func InterfaceToBool(value interface{}) bool
func InterfaceToFloat64 ¶
func InterfaceToFloat64Array ¶
InterfaceToFloat64Array 接口转 float64 数组
func InterfaceToInt ¶
func InterfaceToInt16 ¶
func InterfaceToInt32 ¶
func InterfaceToInt64 ¶
func InterfaceToInt64Array ¶
InterfaceToInt64Array 接口转int64数组
func InterfaceToInt8 ¶
func InterfaceToMap ¶
InterfaceToMap 接口转 map
func InterfaceToStringArray ¶
InterfaceToStringArray 接口转字符串数组
func InterfaceToTime ¶
func InterfaceToUint ¶
func InterfaceToUint16 ¶
func InterfaceToUint32 ¶
func InterfaceToUint64 ¶
func InterfaceToUint64Array ¶
InterfaceToUint64Array 接口转 uint64 数组
func InterfaceToUint8 ¶
func JoinUint64 ¶
func QuickReplaceLFCR ¶
QuickReplaceLFCR 替换 \r(回车)、\n(换行) 为字符串 `\r`、`\n`
func QuickReplaceLFCR2Space ¶
QuickReplaceLFCR2Space 替换 \r(回车)、\n(换行) 为空格
func SplitInt64 ¶
func SplitUint64 ¶
func StringToBytes ¶
StringToBytes converts string to a byte slice without memory allocation.
Note it may break if the implementation of string or slice header changes in the future go versions.
Types ¶
type Map ¶
type Map map[string]interface{}
func (Map) GetFloat64Array ¶
func (Map) GetInt64Array ¶
func (Map) GetStringArray ¶
func (Map) GetUint64Array ¶
Click to show internal directories.
Click to hide internal directories.