util

package
v1.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2022 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64D

func Base64D(body string) string

func Base64E

func Base64E(body string) string

func ComputeHmac256

func ComputeHmac256(message string, secret string) string

ComputeHmac256 HMAC with the SHA256

func CopyFF

func CopyFF(src io.Reader, dst io.Writer) error

func CopyFS

func CopyFS(src io.Reader, dst string) error

func CurDir

func CurDir() string

func DivideStringList

func DivideStringList(files []string, num int) (map[int][]string, error)

func FileExist

func FileExist(filename string) bool

func GetBinaryCurrentPath

func GetBinaryCurrentPath() (string, error)

func GetCurrentPath

func GetCurrentPath() (string, error)

func GetFileSuffix

func GetFileSuffix(f string) string

func GetFilenameInfo

func GetFilenameInfo(filepath string) (os.FileInfo, error)

func HasFile

func HasFile(s string) bool

func IS

func IS(i int) string

func InArray

func InArray(sa []string, a string) bool

func Input

func Input(say, defaults string) string

func IsDir

func IsDir(filepath string) bool

func IsFile

func IsFile(filepath string) bool

func JsonBack

func JsonBack(s []byte) ([]byte, error)

func ListDir

func ListDir(dirPth string, suffix string) (files []string, err error)

func ListDirOnlyName

func ListDirOnlyName(dirPth string, suffix string) (files []string, err error)

func MakeDir

func MakeDir(fileDir string) error

func MakeDirByFile

func MakeDirByFile(filepath string) error

func Md5

func Md5(str string) string

func Md5FS

func Md5FS(src io.Reader) string

func ReadFromFile added in v1.0.9

func ReadFromFile(filepath string) ([]byte, error)

func Rename

func Rename(oldFilename string, newFilename string) error

func SI

func SI(s string) (i int, e error)

func SaveToFile

func SaveToFile(filePath string, content []byte) error

func Second

func Second(times int) time.Duration

func SizeofDir

func SizeofDir(dirPth string) int

func Sleep

func Sleep(waitTime int)

func StrToMd5 added in v1.0.9

func StrToMd5(s string) string

StrToMd5 create md5 string

func Substr

func Substr(str string, start, length int) string

func ToLower

func ToLower(s string) string

func TodayString

func TodayString(level int) string

func UrlD

func UrlD(s string) string

func UrlE

func UrlE(s string) string

func ValidBackFileName

func ValidBackFileName(filename string) string

func ValidFileName

func ValidFileName(filename string) string

func WalkDir

func WalkDir(dirPth, suffix string) (files []string, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL