common

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version   string = "dev"
	BuildTime string = "unknown"
	GitCommit string = "unknown"
)
View Source
var ReqClient *req.Client

Functions

func FileExists

func FileExists(path string) bool

func GetDownloadedFilePath

func GetDownloadedFilePath(filename string) string

func Init

func Init()

func MkCache

func MkCache(path string, data []byte, td time.Duration)

func MkFile

func MkFile(path string, data []byte) error

创建文件, 自动创建目录

func PurgeFile

func PurgeFile(path string) error

删除文件, 并清理空目录. 如果文件不存在则返回 nil

func PurgeFileAfter

func PurgeFileAfter(path string, td time.Duration)

在指定时间后删除和清理文件 (定时器)

func RemoveEmptyDirectories

func RemoveEmptyDirectories(dirPath string) error

递归删除空目录

Types

This section is empty.

Jump to

Keyboard shortcuts

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