kutl

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteToFloat64

func ByteToFloat64(bytes []byte) float64

ByteToFloat64 byte转Float64

func BytesToInt

func BytesToInt(bys []byte) int

func BytesToInt64

func BytesToInt64(bys []byte) int64

func Cost

func Cost(t time.Time, label ...string)

func Decimal

func Decimal(v float64) float64

func DeepCopy

func DeepCopy(dst, src interface{}) error

DeepCopy 深度拷贝

func Difference

func Difference(slice1, slice2 []string) []string

Difference 求差集 slice1-并集

func DownloadPictureBytes

func DownloadPictureBytes(url string, timeout time.Duration) (res []byte, err error)

func Float64ToByte

func Float64ToByte(float float64) []byte

Float64ToByte Float64转byte

func GetCurrentDirectory

func GetCurrentDirectory() string

GetCurrentDirectory ...

func GetTodayZeroPoint

func GetTodayZeroPoint() int64

GetTodayZeroPoint ..

func GetTodayZeroPointTime

func GetTodayZeroPointTime() time.Time

GetTodayZeroPointTime ..

func GetYesterdayZeroPoint

func GetYesterdayZeroPoint() int64

GetYesterdayZeroPoint ..

func Int64ToBytes

func Int64ToBytes(data int64) []byte

func IntToBytes

func IntToBytes(n int) []byte

func Intersect

func Intersect(slice1, slice2 []string) []string

Intersect 求交集

func Ints2String

func Ints2String(ints []int) string

func IsFileExists

func IsFileExists(path string) (bool, error)

IsFileExists ...

func IsSliceEqual

func IsSliceEqual(a, b interface{}) bool

IsSliceEqual ..

func Kv2MapInt

func Kv2MapInt(in []Kv) (out map[int]int)

func Kv2MapStr

func Kv2MapStr(in []Kv) (out map[string]string)

func KvFormat

func KvFormat(in []Kv) string

KvFormat TCP:9001,TCP:9003

func LabelsToString

func LabelsToString(labels map[string]string) string

func MapKeyString2Int

func MapKeyString2Int(in map[string]int) (out map[int]int)

func MergeLabels

func MergeLabels(old map[string]string, new map[string]string) map[string]string

MergeLabels merge label the new map will overwrite the old one. e.g. new: {"foo": "newbar"} old: {"foo": "bar"} will return {"foo": "newbar"}

func Microsecond

func Microsecond() int64

func Millisecond

func Millisecond() int64

func String2Timestamp

func String2Timestamp(str string) int64

String2Timestamp 会将当前时间转换为时间戳。

func SyncMapLen

func SyncMapLen(m *sync.Map) int

func Timestamp2String

func Timestamp2String(timestamp int) string

Timestamp2String 会格式化当前时间。

func Timestamp2String64

func Timestamp2String64(timestamp int64) string

func Union

func Union(slice1, slice2 []string) []string

Union 求并集

Types

type Kv

type Kv struct {
	Key   interface{} `json:"key"`
	Value interface{} `json:"value"`
}

func KvUnFormat

func KvUnFormat(in string) []Kv

KvUnFormat TCP:9001,TCP:9003

func MapInt2Kv

func MapInt2Kv(in map[int]int) []Kv

func MapString2Kv

func MapString2Kv(in map[string]string) []Kv

Jump to

Keyboard shortcuts

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