utils

package
v3.8.1-rc.20 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 17 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanUpfuncName

func CleanUpfuncName(funcName string) string

func CopyFile

func CopyFile(srcName string, dstName string) (written int64, err error)

func DifferenceSubset

func DifferenceSubset(mainSlice, subSlice []int64) []int64

Get the diff of two slices

func FileExist

func FileExist(filename string) bool

func FileTmpPath

func FileTmpPath(fullPath, dbPrefix string) string

func FirstLower

func FirstLower(s string) string

func GetConversationIDByGroupID

func GetConversationIDByGroupID(groupID string) string

func GetConversationIDByMsg

func GetConversationIDByMsg(msg *sdk_struct.MsgStruct) string

func GetConversationTableName

func GetConversationTableName(conversationID string) string

func GetCurrentTimestampByMill

func GetCurrentTimestampByMill() int64

Get the current timestamp by Mill

func GetCurrentTimestampByNano

func GetCurrentTimestampByNano() int64

Get the current timestamp by Nano

func GetErrTableName

func GetErrTableName(conversationID string) string

func GetMsgID

func GetMsgID(sendID string) string

func GetSelfFuncName

func GetSelfFuncName() string

func GetSwitchFromOptions

func GetSwitchFromOptions(Options map[string]bool, key string) (result bool)

func GetTableName

func GetTableName(conversationID string) string

func Int64ToString

func Int64ToString(i int64) string

func IntToString

func IntToString(i int) string

func IsContain

func IsContain(target string, List []string) bool

judge a string whether in the string list

func IsContainInt

func IsContainInt(target int, List []int) bool

func JsonStringToStruct

func JsonStringToStruct(s string, args interface{}) error

The incoming parameter must be a pointer

func KMP

func KMP(rMainString string, rSubString string) (isInMainString bool)

func Md5

func Md5(s string) string

func OperationIDGenerator

func OperationIDGenerator() string

func SetSwitchFromOptions

func SetSwitchFromOptions(Options map[string]bool, key string, value bool)

func StructToJsonString

func StructToJsonString(param interface{}) string

func StructToJsonStringDefault

func StructToJsonStringDefault(param interface{}) string

func TimeToString

func TimeToString(t time.Time) string

func TrimStringList

func TrimStringList(list []string) (result []string)

func UnixSecondToTime

func UnixSecondToTime(second int64) time.Time

func UnmarshalNotificationElem

func UnmarshalNotificationElem(bytes []byte, t interface{}) error

func Wrap

func Wrap(err error, message string) error

Types

type LockPool added in v3.8.1

type LockPool struct {
	// contains filtered or unexported fields
}

resource manager

func NewLockPool added in v3.8.1

func NewLockPool(maxLocks int) *LockPool

func (*LockPool) Lock added in v3.8.1

func (lp *LockPool) Lock(key string)

func (*LockPool) Unlock added in v3.8.1

func (lp *LockPool) Unlock(key string)

Jump to

Keyboard shortcuts

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