tfile

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: GPL-2.0 Imports: 17 Imported by: 0

Documentation

Overview

* @Author: Keven * @version: v1.0.1 * @Date: 2021-04-09 20:32:12 * @LastEditors: Keven * @LastEditTime: 2021-04-09 20:53:10

* @Author: Keven * @version: v1.0.1 * @Date: 2021-03-08 15:02:40 * @LastEditors: Keven * @LastEditTime: 2021-09-28 11:26:44

* @Author: Feng * @version: v1.0.0 * @Date: 2020-09-14 08:19:46 * @LastEditors: Keven * @LastEditTime: 2021-10-08 10:38:09

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBucket       = errors.New("Invalid Image bucket!")
	ErrSize         = errors.New("Invalid Image size!")
	ErrInvalidImage = errors.New("Invalid Image Type!")
)

Functions

func AcceptImgType

func AcceptImgType(imgType string) bool

AcceptImgType 系统接受的图片类型

func B64ImageSave

func B64ImageSave(savePath, data string, config ImageConf) (suffix string, err error)

func Copy

func Copy(src, dst string) (int64, error)

func DirSize

func DirSize(path string) (int64, error)

DirSize 获取文件夹大小

func GetAllFiles

func GetAllFiles(dirPth string) (files []string, err error)

GetAllFiles 获取指定目录下的所有文件,包含子目录下的文件

func HttpGet

func HttpGet(imgUrl, savePath string) (fileName string, err error)

func Mkdir

func Mkdir(dir string) (err error)

Mkdir 文件目录不存在则创建

func UnzipDir

func UnzipDir(zipFile, dir string) (err error)

UnzipDir解压缩zip文件

func ZipDir

func ZipDir(dir, zipFile string) (err error)

压缩文件夹为 zip文件

Types

type FinfoPath

type FinfoPath struct {
	Finfo os.FileInfo
	Fpath string
}

func Flist

func Flist(dirPth string) (files []FinfoPath, err error)

type ImageConf

type ImageConf struct {
	MaxWidth  int
	MaxHeight int
}

Jump to

Keyboard shortcuts

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