Documentation
¶
Index ¶
- func AesEncrypt(key []byte, text []byte) string
- func BcryptCheck(password, hash string) bool
- func BcryptHash(password string) string
- func CopyStruct(dst, src interface{})
- func Decrypt(key []byte, ciphertext []byte) ([]byte, error)
- func Encrypt(key []byte, text []byte) ([]byte, error)
- func FileExists(filename string) (bool, error)
- func GetDefaultHttpClient() *req.Client
- func GetDistance(lat, lon float64, lat2, lon2 float64) float64
- func GetFreePort() (int, error)
- func GetRandInt64() string
- func GetUUID() string
- func GetUUIDStr() string
- func IF[V any](predicate bool, then V, otherwise V) V
- func If[V any](predicate bool, then func() V, otherwise func() V) V
- func InitDockerMysqlForTest() (string, string, error)
- func IsEmptyArrayOrSlice(i interface{}) bool
- func MD5V(str []byte, b ...byte) string
- func Md5(str string) string
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(ciphertext []byte) []byte
- func RandInt(min, max int) int
- func ReGroup[T1 any, T2 comparable](list []T1, fn func(a T1) T2) map[T2][]T1
- func StopDockerMysqlForTest(containerName string) error
- func ToAnyArray[T any](list []T) []any
- func ToJson(data interface{}) (string, error)
- func ToJsonWithoutErr(data interface{}, defaultVal string) string
- func UnmarshalJson(jsonStr string, data interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AesEncrypt ¶
func CopyStruct ¶
func CopyStruct(dst, src interface{})
CopyStruct ,浅复制! dst 目标结构体,src 源结构体 必须传入指针,且不能为nil 它会把src与dst的相同字段名的值,复制到dst中
func FileExists ¶
func GetDefaultHttpClient ¶
func GetDefaultHttpClient() *req.Client
func GetDistance ¶
func GetFreePort ¶
func GetRandInt64 ¶
func GetRandInt64() string
func GetUUIDStr ¶
func GetUUIDStr() string
func InitDockerMysqlForTest ¶
func IsEmptyArrayOrSlice ¶
func IsEmptyArrayOrSlice(i interface{}) bool
func PKCS5Padding ¶
func PKCS5UnPadding ¶
func ReGroup ¶
func ReGroup[T1 any, T2 comparable](list []T1, fn func(a T1) T2) map[T2][]T1
func StopDockerMysqlForTest ¶
func ToAnyArray ¶
func ToJsonWithoutErr ¶
ToJsonWithoutErr 对象转 json 字符串,忽略异常
func UnmarshalJson ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.