Documentation ¶
Index ¶
- func CompareFile(file1, file2 string) (bool, error)
- func Copy(src, dst string) (cnt int64, err error)
- func CreateTempDir() (result string, err error)
- func DownloadWithDir(ctx context.Context, srcUrl string, targetDir string, ...) (err error)
- func DownloadWithDirAndName(ctx context.Context, srcUrl string, targetDir string, targetName string, ...) (err error)
- func DownloadWithPath(ctx context.Context, srcUrl string, targetPath string, ...) (err error)
- func Exists(name string) bool
- func GbkToUtf8(s []byte) ([]byte, error)
- func GetExecParentDir() (result string, err error)
- func InitLogger(toConsole bool, toFile bool, logRoot string) (logger *zerolog.Logger, err error)
- func IsDir(dir string) bool
- func PureName(name string) string
- func RecordData(recorder *Recorder, data interface{}) (err error)
- func SetRecordWriter(recorder *Recorder, writer Writer)
- func Utf8ToGbk(s []byte) ([]byte, error)
- type FileWriter
- type Recorder
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareFile ¶ added in v0.2.1
func CreateTempDir ¶ added in v0.2.2
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 GetExecParentDir ¶ added in v0.2.0
func InitLogger ¶ added in v0.1.5
func RecordData ¶ added in v0.0.6
写入已经json序列化好的字符数组,字符串或者是可以进行json序列化的对象
func SetRecordWriter ¶ added in v0.0.9
Types ¶
type FileWriter ¶ added in v0.0.9
type FileWriter struct {
// contains filtered or unexported fields
}
func NewFileWriter ¶ added in v0.1.0
func NewFileWriter(file *os.File) *FileWriter
func (*FileWriter) Close ¶ added in v0.0.9
func (writer *FileWriter) Close() (err error)
func (*FileWriter) Sync ¶ added in v0.0.9
func (writer *FileWriter) Sync() (err error)
Click to show internal directories.
Click to hide internal directories.