util

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(src, dest string) error

CopyFile 复制文件

func Download

func Download(urlStr, filename string) (err error)

Download 下载文件

func DownloadTo

func DownloadTo(urlStr, saveDir string) (filename string, err error)

DownloadTo 下载到目录

func IsDir

func IsDir(dir string) bool

IsDir 检查是否目录

func IsFile

func IsFile(filename string) bool

IsFile 文件是否存在

func Random

func Random(n int) []byte

Random takes a parameter (int) and returns random slice of byte ex: var randomstrbytes []byte; randomstrbytes = utils.Random(32)

func RandomString

func RandomString(n int) string

RandomString accepts a number(10 for example) and returns a random string using simple but fairly safe random algorithm

func Stringify

func Stringify(v interface{}) string

Stringify json 序列化

func UriToPath

func UriToPath(uri string) (file string, err error)

UriToPath File URI to Path function.

Types

This section is empty.

Jump to

Keyboard shortcuts

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