filetool

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2023 License: GPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadTo

func DownloadTo(url, file string, chkcrt bool) error

DownloadTo 下载到路径

func FormatSize added in v0.0.3

func FormatSize(fileSize int64) (size string)

字节的单位转换 保留两位小数

func IsExist

func IsExist(path string) bool

IsExist 文件/路径存在

func LoadFontFaces

func LoadFontFaces(dc *gg.Context, points float64, path string, name string, filemap map[string][]*zip.File) error

打开map中的ttf文件

func Parsezip

func Parsezip(zipFile string, filemap map[string][]*zip.File) error

加载 zip 文件到 map

Types

type Files

type Files struct {
	Name     string // 文件完整路径
	NameOnly string // 文件完整路径(不带后缀)
	Path     string // 路径(不带文件名)
	FileName string // 完整文件名(不带路径)
	Suffix   string // 文件的后缀(文件类型)
}

func Readir

func Readir(dir, suffix string) ([]Files, int, error)

获取指定文件夹指定后缀文件的 绝对/相对 路径

type Ftool added in v0.0.3

type Ftool struct {
	Open bool          // 是否打开
	Ok   bool          // 是否存在
	Err  error         // 错误
	Data io.ReadCloser //
	File *zip.File     //
}

func Findfile

func Findfile(path string, name string, open bool, filemap map[string][]*zip.File) Ftool

查找map中的文件

Jump to

Keyboard shortcuts

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