Documentation ¶
Index ¶
- Constants
- func AsyncCall(f func())
- func ByteFormat(b int64) string
- func ByteParse(val string) (int64, error)
- func ByteToFloat64(bytes []byte) float64
- func BytesToInt(bys []byte) int
- func BytesToInt64(bys []byte) int64
- func Decimal(v float64) float64
- func DeepCopy(dst, src interface{}) error
- func Difference(slice1, slice2 []string) []string
- func Float64ToByte(float float64) []byte
- func Go(fn func())
- func Hash(s string) uint32
- func I2S[T Int](i T) string
- func InputCheck(input string) bool
- func Int64ToBytes(data int64) []byte
- func IntToBytes(n int) []byte
- func Intersect(slice1, slice2 []string) []string
- func Ints2String(ints []int) string
- func IsSliceEqual(a, b interface{}) bool
- func Kv2MapInt(in []Kv) (out map[int]int)
- func Kv2MapStr(in []Kv) (out map[string]string)
- func KvFormat(in []Kv) string
- func LabelsToString(labels map[string]string) string
- func MapKeyString2Int(in map[string]int) (out map[int]int)
- func MergeLabels(old map[string]string, new map[string]string) map[string]string
- func Page(from, to, size int64, fn func(from, to int64) error) error
- func S2I64(str string) int64
- func S2UI64(str string) uint64
- func Strings2Map(ss []string) map[string]struct{}
- func SyncMapLen(m *sync.Map) int
- func UI2S[T Uint](i T) string
- func Union(slice1, slice2 []string) []string
- type Bytes
- type Int
- type Kv
- type Uint
Constants ¶
View Source
const ( KB MB GB TB PB EB )
Variables ¶
This section is empty.
Functions ¶
func BytesToInt ¶
func BytesToInt64 ¶
func InputCheck ¶
func Int64ToBytes ¶
func IntToBytes ¶
func Ints2String ¶
func LabelsToString ¶
func MergeLabels ¶
MergeLabels merge label the new map will overwrite the old one. e.g. new: {"foo": "newbar"} old: {"foo": "bar"} will return {"foo": "newbar"}
func Page ¶
通过入参 from to 根据 size 对函数调用进行分页查询,闭区间 例如:from=0 to=100 size=10 则会调用 10 次函数,每次入参为 from=0 to=10, from=10 to=20, from=20 to=30, ..., from=90 to=100
func Strings2Map ¶
func SyncMapLen ¶
Types ¶
type Bytes ¶
type Bytes struct{}
Bytes struct
type Kv ¶
type Kv struct { Key interface{} `json:"key"` Value interface{} `json:"value"` }
func MapString2Kv ¶
Click to show internal directories.
Click to hide internal directories.