utils

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckErr

func CheckErr(err error, message string)

func CheckWorkTime

func CheckWorkTime(work_time string, t time.Time) bool

func CpuNum

func CpuNum() int

func EnsureDir added in v0.0.8

func EnsureDir(dirName string) error

func FileExists

func FileExists(path string) bool

func GenerateRandomString added in v0.0.6

func GenerateRandomString(length int) string

func GetCurrentDirectory

func GetCurrentDirectory() string

func GetLocalIp

func GetLocalIp() string

func GetLogPath

func GetLogPath(curPath string) string

func HmacSHA1

func HmacSHA1(data, key string) []byte

func IndexOfSlice

func IndexOfSlice(item string, slice []string) int

返回 在slice 中的索引值,没有找到的话返回-1

func IsJson

func IsJson(data string) bool

func LocalMac

func LocalMac() string

func OutOfInfo

func OutOfInfo(data string, startCount, endCount int) string

func RandomInt

func RandomInt(end int) int

func RunFuncName

func RunFuncName() string

func StrFirstToLower

func StrFirstToLower(str string) string

func StrFirstToUpper

func StrFirstToUpper(str string) string

func Struct2Map

func Struct2Map(obj interface{}) map[string]interface{}

func Timestamp

func Timestamp() int64

func ToMd5

func ToMd5(str string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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