Documentation ¶
Index ¶
- Variables
- func Arr2Str(strings []string) string
- func BindAndCheck(ctx *gin.Context, data interface{}) error
- 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 FileIsExisted(filename string) bool
- func GenValidateCode(width 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 IsEmpty(name string) (bool, error)
- func IsNotExistMkDir(src string) error
- func MakeDir(dir string) error
- 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 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 Str2Float64(in string) float64
- func Str2Int(inter string) int
- func Str2Int64(inter string) int64
- func Str2Uint(inter string) uint
- func UploadFile(url string, params map[string]string, nameField, fileName string, ...) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( HttpClient = &http.Client{ Timeout: 30 * time.Second, } )
注意client 本身是连接池,不要每次请求时创建client
Functions ¶
func BindAndCheck ¶
func CheckPermission ¶
CheckPermission check if the file has permission
func CreatNestedFile ¶
CreatNestedFile 给定path创建文件,如果目录不存在就递归创建
func DelFilelist ¶
func DelFilelist(path string)
func DistributeFile ¶
func FileIsExisted ¶
func GenValidateCode ¶
func IsNotExistMkDir ¶
IsNotExistMkDir create a directory if it does not exist
func ReturnSpecifyMonth ¶
TODO: 获取当月的最后第一天或者最后一天
func ReturnSpecifyYear ¶
TODO: 获取当年的最后第一天或者最后一天
func Str2Float64 ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.