Documentation
¶
Index ¶
- Constants
- func AesDecrypt(ciphertext []byte, key []byte, iv []byte) ([]byte, error)
- func AesEncrypt(plaintext []byte, key []byte, iv []byte) ([]byte, error)
- func ConvertMap2Slice[T, R any, K constraints.Ordered](val map[K]T, get func(T) (R, bool)) []R
- func ConvertSlice2Map[T any, K constraints.Ordered](arr []T, get func(T) (K, bool)) map[K]T
- func ConvertSlice2Slice[T, R any](arr []T, get func(T) (R, bool)) []R
- func Copy(dst, src interface{}) error
- func FileExist(path string) error
- func FilesExist(path ...string) error
- func GetClientIp(r *http.Request) string
- func InSlice[T comparable](arr []T, v T) bool
- func InSliceElem[T any](arr []T, f func(T) bool) bool
- func Ip2Long(ipStr string) uint32
- func IsPublicIP(IP net.IP) bool
- func Join(s []string, sep string) string
- func JoinFloat[T constraints.Float](s []T, sep string, prec int) string
- func JoinInt[T constraints.Signed](s []T, sep string) string
- func JoinUint[T constraints.Unsigned](s []T, sep string) string
- func NetLong2ip(ip uint32) string
- func ParseGzip(data []byte) ([]byte, error)
- func RandInt32(min, max int32) int32
- func RandInt64(min, max int64) int64
- func RandStr(length int, chars string, mod uint) string
- func Split(s, sep string) []string
- func SubStr(str string, start int, end int) string
- func TimeFormatInLocation(tm time.Time, layout string) string
- func TimeParseInLocation(layout, value string) (time.Time, error)
- func VersionCompare(version1, version2, operator string) bool
Constants ¶
View Source
const ( RandStrModNumber = 0x01 RandStrModUpperCase = 0x02 RandStrModLowerCase = 0x04 )
View Source
const (
TimeFormatYear2Second = "2006-01-02 15:04:05"
)
Variables ¶
This section is empty.
Functions ¶
func ConvertMap2Slice ¶ added in v1.0.0
func ConvertMap2Slice[T, R any, K constraints.Ordered](val map[K]T, get func(T) (R, bool)) []R
func ConvertSlice2Map ¶ added in v1.0.0
func ConvertSlice2Map[T any, K constraints.Ordered](arr []T, get func(T) (K, bool)) map[K]T
func ConvertSlice2Slice ¶ added in v1.0.0
func FilesExist ¶
func GetClientIp ¶
func InSlice ¶
func InSlice[T comparable](arr []T, v T) bool
func InSliceElem ¶
func IsPublicIP ¶
func NetLong2ip ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.