Documentation ¶
Index ¶
- Constants
- Variables
- func AppendStrToFile(path, content string) (err error)
- func Base64Decode(content string) (string, error)
- func Base64Encode(content string) string
- func ContentToQRCodeStr(content string, level qrcode.RecoveryLevel, size int) (string, error)
- func CountDirFiles(dirName string) int
- func CreateDir(path string) error
- func CreateFileByAllPath(fileName string) error
- func FileMD5(file *os.File) (string, error)
- func FileMD5ByPath(path string) (string, error)
- func GeneratedToken(userID int64, phone string, expire int) (string, error)
- func HashPassword(password, salt string) (string, error)
- func HttpGet(ctx context.Context, url string, headers map[string]string, ...) ([]byte, error)
- func HttpPostJson(ctx context.Context, url string, headers map[string]string, body interface{}, ...) ([]byte, error)
- func InterfaceToStr(value interface{}) string
- func IsDir(path string) bool
- func IsExist(path string) bool
- func MkFileFullPathDir(fileName string) error
- func ParseToken(tokenString string) (int64, string, error)
- func RandCharStr(n int) string
- func RandNumStr(n int) string
- func ReadFileToBytes(path string) ([]byte, error)
- func ReadFileToLines(path string) ([]string, error)
- func SplitStrToSubStrArr(s string, l int) []string
- func StrToUint64(str string) uint64
- func StrToUint64E(str string) (uint64, error)
- func Tar(src, dst, trimPrefix string) error
- func Untar(src, dst string) error
- func ValueIsBlank(value reflect.Value) bool
- func ValueMd5(value interface{}) string
- func WriteToFile(content interface{}, path string) error
- type Claims
- type FileInfo
Constants ¶
View Source
const ( FileMode0755 = 0755 FileMode0644 = 0644 )
Variables ¶
View Source
var ( CharArr = []byte("ABCDEFGHIJKLMNOPQRSTUVWXYZ") NumArr = []byte("1234567890") )
Functions ¶
func AppendStrToFile ¶
AppendStrToFile 在已经存在的文件中,添加字符串
func Base64Decode ¶
func Base64Encode ¶
func ContentToQRCodeStr ¶
ContentToQRCodeStr 根据content返回二维码图片的base64
func CountDirFiles ¶
func CreateFileByAllPath ¶
func GeneratedToken ¶
GeneratedToken ...
func HashPassword ¶
func HttpGet ¶
func HttpGet(ctx context.Context, url string, headers map[string]string, params map[string]interface{}, timeout ...time.Duration) ([]byte, error)
HttpGet 发送get请求
func HttpPostJson ¶
func HttpPostJson(ctx context.Context, url string, headers map[string]string, body interface{}, timeout ...time.Duration) ([]byte, error)
HttpPostJson 以json格式发送post请求
func MkFileFullPathDir ¶
func ReadFileToLines ¶
ReadFileToLines 按行读取文件为字符串数组
func SplitStrToSubStrArr ¶
SplitStrToSubStrArr 字符串根据长度切割为字符串数组
func StrToUint64E ¶
StrToUint64E string to uint64 with error
func ValueIsBlank ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.