util

package
v0.0.0-...-1b09624 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToInt64

func BytesToInt64(buf []byte) int64

func CalRequestSign

func CalRequestSign(request map[string]string, secret string) string

func CheckSum

func CheckSum(data []byte) uint16

func GetCurrTime

func GetCurrTime() int64

func GetCurrTimeMicors

func GetCurrTimeMicors() int64

func GetCurrTimeMs

func GetCurrTimeMs() int64

func GetCurrTimeNs

func GetCurrTimeNs() int64

func GetDurationMicros

func GetDurationMicros(begin time.Time) int64

获取微秒间隔

func GetDurationMillis

func GetDurationMillis(begin time.Time) int64

获取毫秒间隔

func GetInternalIP

func GetInternalIP() (string, error)

func GetTraceId

func GetTraceId() string

func Hostname

func Hostname() (string, error)

func IdcName

func IdcName() string

func Int64ToBytes

func Int64ToBytes(i int64) []byte

func Md5

func Md5(str string) string

func Mkdir

func Mkdir(dir string, perm os.FileMode) (bool, error)

func OpenFile

func OpenFile(path string, filename string, flag int, perm os.FileMode) (*os.File, error)

func PathExists

func PathExists(path string) (bool, error)

func Sha1

func Sha1(args ...string) string

func StringArrayHas

func StringArrayHas(data []string, needle string) bool

func StringArrayIntersect

func StringArrayIntersect(src []string, dst []string) []string

func StructToJson

func StructToJson(data interface{}) string

func TransferISO2Timestamp

func TransferISO2Timestamp(isoTime string) (int64, error)

iso-time 转换为 时间戳

Types

This section is empty.

Jump to

Keyboard shortcuts

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