Documentation
¶
Index ¶
- Variables
- func Arr2Str(strings []string) string
- func BindAndCheck(ctx *gin.Context, data interface{}) error
- func BoolToString(bool2 bool) string
- func CalculateAge(birthday string) int
- func CalculateAgeTime(birthday time.Time) int
- func CheckNotExist(src string) bool
- func CheckPermission(src string) bool
- func CopyDir(srcPath, desPath string) error
- func CopyFile(src, des string) (written int64, err error)
- func CreatNestedFile(path string) (*os.File, error)
- func DelFilelist(path string)
- func DistributeFile(url string, params map[string]string, nameField, path string) ([]byte, error)
- func Exists(name string) bool
- func ExtractCNAndENAndNum(s string) []string
- func ExtractDomain(rawURL string) (string, error)
- func ExtractPath(rawURL string) (string, error)
- func ExtractScheme(rawURL string) (string, error)
- func FileIsExisted(filename string) bool
- func FlatToNested(input map[string]interface{}) map[string]interface{}
- func GenValidateCode(width int) string
- func GenerateClientId() string
- func GenerateClientSecretHex() string
- func GenerateRandHex(num int) string
- func GetClientIP(ctx context.Context) (string, error)
- func GetExt(fileName string) string
- func GetSize(f multipart.File) (int, error)
- func Int2Str(inter int) string
- func Int642Str(inter int64) string
- func Int64Str(inter int64) string
- func IsDouyinClient(userAgent string) bool
- func IsEmpty(name string) (bool, error)
- func IsMobile(userAgent string) bool
- func IsNotExistMkDir(src string) error
- func IsWxClient(userAgent string) bool
- func MakeDir(dir string) error
- func MaskPhoneDynamic(phone string) string
- func MaskPhoneWithRegex(phone string) string
- func MkDir(src string) error
- func Mkdir(path string) error
- func MustOpen(fileName, filePath string) (*os.File, error)
- func Open(name string, flag int, perm os.FileMode) (*os.File, error)
- func PrintMemoryUsage()
- func RandInt(min, max int) int
- func RandInt64(min, max int64) int
- func RandStringRunes(n int) string
- func Replace(table map[string]string, s string) string
- func ReturnSpecifyMonth(year, month int) (time.Time, time.Time)
- func ReturnSpecifyYear(year int) (time.Time, time.Time)
- func Sha1(str string) string
- func SliceInt2Str(inters interface{}) string
- func SplitAndDedup(s string) []string
- func SplitBySymbolsAndDedup(s string) []string
- func Str2Float64(in string) float64
- func Str2Int(inter string) int
- func Str2Int64(inter string) int64
- func Str2Uint(inter string) uint
- func Str2Uint32(inter string) uint32
- func StringToBool(string2 string) bool
- func UploadFile(url string, params map[string]string, nameField, fileName string, ...) ([]byte, error)
- type WeChatShareConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( HttpClient = &http.Client{ Timeout: 30 * time.Second, } )
注意client 本身是连接池,不要每次请求时创建client
Functions ¶
func BindAndCheck ¶
func BoolToString ¶
func CalculateAge ¶
func CalculateAgeTime ¶
func CheckPermission ¶
CheckPermission check if the file has permission
func CreatNestedFile ¶
CreatNestedFile 给定path创建文件,如果目录不存在就递归创建
func DelFilelist ¶
func DelFilelist(path string)
func DistributeFile ¶
func ExtractCNAndENAndNum ¶ added in v0.0.73
func ExtractDomain ¶ added in v0.0.62
func ExtractPath ¶ added in v0.0.62
func ExtractScheme ¶ added in v0.0.62
func FileIsExisted ¶
func FlatToNested ¶ added in v0.0.50
func GenValidateCode ¶
func GenerateClientId ¶
func GenerateClientId() string
func GenerateClientSecretHex ¶
func GenerateClientSecretHex() string
func GenerateRandHex ¶
func IsDouyinClient ¶ added in v0.0.72
func IsNotExistMkDir ¶
IsNotExistMkDir create a directory if it does not exist
func IsWxClient ¶ added in v0.0.72
func MaskPhoneDynamic ¶
func MaskPhoneWithRegex ¶
func PrintMemoryUsage ¶
func PrintMemoryUsage()
func ReturnSpecifyMonth ¶
TODO: 获取当月的最后第一天或者最后一天
func ReturnSpecifyYear ¶
TODO: 获取当年的最后第一天或者最后一天
func SplitAndDedup ¶ added in v0.0.73
func SplitBySymbolsAndDedup ¶ added in v0.0.73
func Str2Float64 ¶
func Str2Uint32 ¶
func StringToBool ¶
Types ¶
type WeChatShareConfig ¶
type WeChatShareConfig struct {}
func GetWeChatShareConfig ¶
func GetWeChatShareConfig(debug bool, ticket, shareLink, appid string, JsApiList []string) WeChatShareConfig
Click to show internal directories.
Click to hide internal directories.