Documentation ¶
Index ¶
- Constants
- func AesDecryptECB(encrypted []byte, key []byte) (decrypted []byte)
- func AesEncryptECB(origData []byte, key []byte) (encrypted []byte)
- func ClientIP(r *http.Request) string
- func Copy(toValue interface{}, fromValue interface{}) (err error)
- func DirectClientIP(r *http.Request) string
- func DownloadFile(url string, filename string) error
- func F2y(amount int64) float64
- func Fen2Y(amount int64) string
- func Fen2Yuan(amount int64) string
- func GetDays(str string) int
- func GetUserAgent(req *http.Request) string
- func GzipCompress(gzData string) (string, error)
- func GzipUnCompress(gzData string) (string, error)
- func InSliceInt64(val int64, s []int64) bool
- func InSliceStr(val string, s []string) bool
- func IpIsInternal(ip string) bool
- func IsDev() bool
- func IsExist(path string) bool
- func IsMap(i interface{}) bool
- func IsNumeric(str string) bool
- func IsProd() bool
- func MapToStruct(data map[string]interface{}, result interface{}) error
- func MaskNameEnd(name string, appendLen int, appendStr string) string
- func MaskNameFront(name string) string
- func MaskPhone(phone string) string
- func MaskPhoneEndFront(phone string, appendLen int, appendStr string) string
- func Md5(input []byte) string
- func MustInt64(v interface{}, defaultval ...int64) int64
- func MustString(v interface{}, defaultval ...string) string
- func NullTimeFormat(t sql.NullTime) string
- func ParseTime(str string) time.Time
- func RandStr(length int) (string, error)
- func Shuffle[T any](slice []T)
- func StructToMap(data interface{}) map[string]interface{}
- func TryInt64(v interface{}) (int64, bool)
- func TryParseTime(str string) (time.Time, error)
- func TryString(v interface{}) (string, bool)
- func Xlsx(data [][]interface{}, sheetName string) (*excelize.File, error)
- func XlsxV2(data [][]interface{}, sheetName string) (*excelize.File, error)
- type Empty
Constants ¶
View Source
const TimeLayout = "2006-01-02 15:04:05"
Variables ¶
This section is empty.
Functions ¶
func AesDecryptECB ¶
AesDecryptECB AES-EBC
func AesEncryptECB ¶
AesEncryptECB AES-EBC
func GetUserAgent ¶
func InSliceInt64 ¶
InSliceInt64 判断slice中是否存在某元素,仅支持小切片
func MapToStruct ¶
MapToStruct map[string]interface{} 转换为结构体
func MaskNameEnd ¶
MaskNameEnd 名称脱敏 保留最后一个字
func MaskPhoneEndFront ¶
MaskPhoneEndFront 手机号脱敏-中件替换8个 *
func MustString ¶
MustString 类型转换-返回string
func StructToMap ¶
func StructToMap(data interface{}) map[string]interface{}
StructToMap 结构体转换为 map[string]interface{}
Types ¶
Click to show internal directories.
Click to hide internal directories.