Documentation ¶
Index ¶
- Variables
- func AesDecrypt(baseStr string, key []byte) (origData []byte, aesErr error)
- func AesEncrypt(origData, key []byte) (string, error)
- func Base64Decode(s string) string
- func Base64Encode(s string) string
- func BasePath() string
- func BytesToString(b []byte) string
- func CBCDecrypt(sign string, key, iv []byte) (string, error)
- func CBCEncrypt(text string, key []byte, iv []byte) (string, error)
- func CapturePanic() (has bool)
- func CompareVersion(ver, cVer string) int
- func CurrentPath() string
- func DecodeBase64(s string) ([]byte, error)
- func EncodeBase64(b []byte) string
- func FileExt(file string) string
- func FindStrBetweenStr(s string, left, right string) string
- func FmtPageParams(pageNum, pageSize int64) (int64, int64)
- func GetLocalIP() (ipv4 string, err error)
- func GetRequestIp(r *http.Request) string
- func InStringArray(s string, arr []string) bool
- func Interface2Float64(d interface{}) float64
- func Interface2Int64(d interface{}) int64
- func InterfaceToArray(records interface{}) []interface{}
- func InterfaceToSqlString(a interface{}) string
- func IsExistPath(path string) bool
- func IsNil(t interface{}) bool
- func LoopDo(f func() bool, dur time.Duration) func()
- func LoopDoI(f func(int64) bool, dur time.Duration) func()
- func MaxInt(a int, b int) int
- func MaxInt64(a int64, b int64) int64
- func Md5Sum(s string) string
- func MinInt(a int, b int) int
- func MinInt64(a int64, b int64) int64
- func MoreValueChooseFloat64(value float64, more ...float64) float64
- func MoreValueChooseInt64(value int64, more ...int64) int64
- func MoreValueChooseString(value string, more ...string) string
- func NewMd5Password(password string, secret string) string
- func NewRequestId() string
- func NewTrueScopeRand() *mrand.Rand
- func PKCS7Padding(ciphertext []byte, blockSize int) []byte
- func PKCS7UnPadding(origData []byte) []byte
- func PadLeftString(str string, l int, pad string) string
- func PadRightString(str string, l int, pad string) string
- func RandCode(l int, chars []string) string
- func RandFigureCode(l int) string
- func RandLetterCode(l int) string
- func RandLetterFigureCode(l int) string
- func RandNickname() string
- func RandOrderNoByDateTime(prefix string, useDate bool, useTime bool, randLen int) string
- func ReadYaml(data interface{}, yamlContent string) error
- func ReadYamlFile(data interface{}, configPath string) error
- func ScanDirFileDo(dir string, fn func(file string, path string) error) error
- func ScanEmbedFsDo(embFs embed.FS, fn func(file string, path string) error) error
- func ScopeCreateSQLv1916(scope *gorm.Scope)
- func ScopeUpdateSQLv1916(scope *gorm.Scope)
- func Signature(params ...string) string
- func SliceInt64ToMap(src []int64) map[int64]bool
- func StringToBytes(s string) []byte
- func TrueScopeRand(min int64, max int64) int64
- func TrueScopeRandNoSafe(min int64, max int64) int64
- type BatchPointCostPrinter
- type CostPoint
Constants ¶
This section is empty.
Variables ¶
var FilePathExist = IsExistPath
FilePathExist 文件路径是否存在
Functions ¶
func AesDecrypt ¶ added in v1.1.46
AesDecrypt AES解密
func AesEncrypt ¶ added in v1.1.46
AesEncrypt AES加密,CBC 注意:aes密钥key的长度必须为16,24,32个字符
func Base64Decode ¶ added in v1.1.10
func Base64Encode ¶ added in v1.1.10
func BytesToString ¶ added in v1.1.43
BytesToString converts byte slice to string without a memory allocation.
func CBCDecrypt ¶ added in v1.1.46
CBCDecrypt CBC解密
func CBCEncrypt ¶ added in v1.1.46
CBCEncrypt CBC加密
func CapturePanic ¶ added in v1.1.46
func CapturePanic() (has bool)
func CompareVersion ¶ added in v1.1.7
CompareVersion 比较版本,-1:小于,0:相等,1:大于 v1.1.1 compare v1.2.1
func DecodeBase64 ¶ added in v1.1.46
DecodeBase64 base64解码处理
func FindStrBetweenStr ¶ added in v1.1.45
FindStrBetweenStr 查找left和right字符串中间的字符串
func FmtPageParams ¶ added in v1.1.7
func GetRequestIp ¶ added in v1.1.7
returns request real ip.
func InStringArray ¶ added in v1.1.9
func Interface2Float64 ¶ added in v1.1.43
func Interface2Float64(d interface{}) float64
Interface2Float64 任意值转float64
func Interface2Int64 ¶ added in v1.1.19
func Interface2Int64(d interface{}) int64
Interface2Int64 任意值转int64
func InterfaceToArray ¶ added in v1.1.46
func InterfaceToArray(records interface{}) []interface{}
InterfaceToArray 转换任意interface{}为数组interface{}
func InterfaceToSqlString ¶ added in v1.1.43
func InterfaceToSqlString(a interface{}) string
func MoreValueChooseFloat64 ¶ added in v1.1.46
MoreValueChooseFloat64 多个值选择string,若没有more则默认value,有more则选择more的第一个
func MoreValueChooseInt64 ¶ added in v1.1.46
MoreValueChooseInt64 多个值选择int64,若没有more则默认value,有more则选择more的第一个
func MoreValueChooseString ¶ added in v1.1.46
MoreValueChooseString 多个值选择string,若没有more则默认value,有more则选择more的第一个
func NewMd5Password ¶ added in v1.1.7
func NewRequestId ¶
func NewRequestId() string
func NewTrueScopeRand ¶ added in v1.1.46
func PKCS7Padding ¶ added in v1.1.46
PKCS7Padding 填充加密块
func PKCS7UnPadding ¶ added in v1.1.46
PKCS7UnPadding 清除加密块中填充字节
func PadLeftString ¶ added in v1.1.46
PadLeftString 左填充字符串至指定长度
func PadRightString ¶ added in v1.1.46
PadRightString 右填充字符串至指定长度
func RandFigureCode ¶ added in v1.1.8
func RandLetterCode ¶ added in v1.1.8
func RandLetterFigureCode ¶ added in v1.1.8
func RandOrderNoByDateTime ¶ added in v1.1.46
RandOrderNoByDateTime 按日期生成单据编号,类似: TX202404230714209992
func ReadYamlFile ¶ added in v1.1.7
func ScanDirFileDo ¶ added in v1.1.46
ScanDirFileDo 扫描目录文件并执行操作
func ScanEmbedFsDo ¶ added in v1.1.43
ScanEmbedFsDo 扫描文件操作 注意:下划线文件不会被 embed.FS 嵌入打包进来
func ScopeCreateSQLv1916 ¶ added in v1.1.43
ScopeCreateSQLv1916 使用gorm scope生成create sql和vars(适用于gorm v1.9.16版本) copy from gorm source code scope.SQL, scope.SQLVars
func ScopeUpdateSQLv1916 ¶ added in v1.1.44
ScopeUpdateSQLv1916 使用gorm scope生成update sql和vars(适用于gorm v1.9.16版本) copy from gorm source code scope.SQL, scope.SQLVars
func SliceInt64ToMap ¶ added in v1.1.44
SliceInt64ToMap 切片转map(去重)
func StringToBytes ¶ added in v1.1.43
StringToBytes converts string to byte slice without a memory allocation.
func TrueScopeRand ¶ added in v1.1.45
TrueScopeRand 真随机数,范围随机,min<= V <max
func TrueScopeRandNoSafe ¶ added in v1.1.46
TrueScopeRandNoSafe 真随机数(非并发安全) 全局使用一个rand的情况下会引发数组panic(未知原因)
Types ¶
type BatchPointCostPrinter ¶ added in v1.1.45
BatchPointCostPrinter 批量点位耗时打印
func NewBatchPointCostPrinter ¶ added in v1.1.45
func NewBatchPointCostPrinter() *BatchPointCostPrinter
func (*BatchPointCostPrinter) AddPoint ¶ added in v1.1.45
func (printer *BatchPointCostPrinter) AddPoint(name string)
func (*BatchPointCostPrinter) Print ¶ added in v1.1.45
func (printer *BatchPointCostPrinter) Print(id string, ts ...*CostPoint)