ioutils

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: BSD-3-Clause Imports: 13 Imported by: 1

README

ioutils

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadWithDir

func DownloadWithDir(ctx context.Context, srcUrl string, targetDir string, funcs ...func(length, downloaded int64)) (err error)

将文件下载存储到指定目录

func DownloadWithDirAndName

func DownloadWithDirAndName(ctx context.Context, srcUrl string, targetDir string, targetName string, funcs ...func(length, downloaded int64)) (err error)

下载文件

func DownloadWithPath

func DownloadWithPath(ctx context.Context, srcUrl string, targetPath string, funcs ...func(length, downloaded int64)) (err error)

将文件下载存储到指定路径

func Exists

func Exists(name string) bool

Exists reports whether the named file or directory exists.

func IsDir

func IsDir(dir string) bool

func PureName

func PureName(name string) string

func RecordData added in v0.0.6

func RecordData(recoder *Recorder, data interface{}) (err error)

写入已经json序列化好的字符数组,字符串或者是可以进行json序列化的对象

Types

type Recorder added in v0.0.6

type Recorder struct {
	// contains filtered or unexported fields
}

func StartRecorder added in v0.0.6

func StartRecorder(ctx context.Context, filename string) *Recorder

开启存储数据的服务,并返回对象用于后续写数据

Jump to

Keyboard shortcuts

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