common

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version   string = "dev"
	BuildTime string = "unknown"
	GitCommit string = "unknown"
)

Functions

func Init

func Init()

func MkFile

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

创建文件, 自动创建目录

func PurgeFile

func PurgeFile(path string) error

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

func RemoveEmptyDirectories

func RemoveEmptyDirectories(dirPath string) error

递归删除空目录

func RmFileAfter added in v0.3.2

func RmFileAfter(path string, td time.Duration)

Types

type CommonCache added in v0.4.0

type CommonCache struct {
	// contains filtered or unexported fields
}
var Cache *CommonCache

func (*CommonCache) Delete added in v0.4.0

func (c *CommonCache) Delete(key string) error

func (*CommonCache) Get added in v0.4.0

func (c *CommonCache) Get(key string, value *types.File) error

func (*CommonCache) Set added in v0.4.0

func (c *CommonCache) Set(key string, value *types.File, expireSeconds int) error

Jump to

Keyboard shortcuts

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