utils

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile added in v0.1.3

func CopyFile(src, dst string) bool

CopyFile 拷贝文件

func CopyPath added in v0.1.3

func CopyPath(src, dst string) bool

CopyPath 拷贝目录

func DirDot added in v0.1.3

func DirDot() string

func ExecShell added in v0.1.3

func ExecShell(shell string) (stdout string, stderr string)

ExecShell执行shell命令

func Explode added in v0.1.3

func Explode(delimiter, datastr string) (arr []string)

Explode 将字符串按字符拆成数组

func FileExists added in v0.1.4

func FileExists(path string) (bool, error)

func GetFileInfo added in v0.1.3

func GetFileInfo(src string) os.FileInfo

GetFileInfo 获取文件信息

func GetLocalIp added in v0.3.1

func GetLocalIp() string

func GetRandStr

func GetRandStr(n int) (randStr string)

func JsonEncode added in v0.2.8

func JsonEncode(v interface{}, escape bool) string

func Md5ToString

func Md5ToString(str string) string

func RandomCreateBytes added in v0.1.3

func RandomCreateBytes(n int, alphabets ...byte) []byte

RandomCreateBytes generate random []byte by specify chars.

func RemoveFile added in v0.1.6

func RemoveFile(filePath string) error

func ShortTag

func ShortTag(longstr string, number int) string

func Substr

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

Substr字符串截取

func WriteFile added in v0.1.6

func WriteFile(filePath string, content string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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