util

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayNotInArrayString

func ArrayNotInArrayString(original []string, search []string) []string

查找数组中某值是否在数组中

func ConfGetInt

func ConfGetInt(path string) int

func ConfGetInt64

func ConfGetInt64(path string) int64

func ConfGetString

func ConfGetString(path string) string

func ConfGetStringSlice

func ConfGetStringSlice(path string) []string

func ConfGetbool

func ConfGetbool(path string) bool

func DesDecrypt

func DesDecrypt(decrypted, key string) string

解密

func DesEncrypt

func DesEncrypt(text, key string) string

DesEncrypt 加密

func Dump

func Dump(vs ...any)

func EmojiDecode

func EmojiDecode(s string) string

EmojiDecode 表情解码

func EmojiEnCode

func EmojiEnCode(s string) string

EmojiEnCode 表情转换

func GoroutineFunc

func GoroutineFunc(fun interface{}, args ...interface{}) (err error)

func InArrayString

func InArrayString(v string, m *[]string) bool

查找某值是否在数组中

func Int added in v0.1.0

func Int(v any) int

Int convert value to int

func Int64 added in v0.1.0

func Int64(v any) int64

Int64 convert value to int64

func PKCS7Padding

func PKCS7Padding(ciphertext []byte, blockSize int) []byte

func PKCS7UnPadding

func PKCS7UnPadding(origData []byte) []byte

func RandomID

func RandomID() uint64

func RandomIDInt64

func RandomIDInt64() int64

func Recover

func Recover()

用法 通常此函数放在defer 之后 ,形如: defer Recover() 通常是这样用

go func(){
    defer Recover()
    dosomething()
}()

func String added in v0.1.0

func String(v any) string

String always convert value to string, will ignore error

func StringToInt

func StringToInt(str string) int

func StringToInt64

func StringToInt64(str string) int64

func ToInt added in v0.1.0

func ToInt(v any) (int, error)

ToInt try to convert value to int

func ToInt64 added in v0.1.0

func ToInt64(v any) (int64, error)

ToInt64 try to convert value to int64

func ToString added in v0.1.0

func ToString(v any) (string, error)

ToString convert value to string, will return error on fail.

func ToUint added in v0.1.0

func ToUint(v any) (uint64, error)

ToUint try to convert value to uint64

func Uint added in v0.1.0

func Uint(v any) uint64

Uint convert value to uint64

Types

type Encryption

type Encryption struct {
	Key []byte
}

type KeySizeError

type KeySizeError int

func (KeySizeError) Error

func (k KeySizeError) Error() string

Jump to

Keyboard shortcuts

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