common

package
v0.21.3 Latest Latest
Warning

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

Go to latest
Published: May 29, 2025 License: AGPL-3.0 Imports: 14 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 Cache *cache.Cache[any]
View Source
var TagRe = regexp.MustCompile(`(?:^|[\p{Zs}\s.,!?(){}[\]<>\"\',。!?():;、])#([\p{L}\d_]+)`)

Functions

func CacheDelete added in v0.20.0

func CacheDelete(ctx context.Context, key string) error

func CacheGet added in v0.20.0

func CacheGet[T any](ctx context.Context, key string) (T, error)

func CacheSet added in v0.20.0

func CacheSet(ctx context.Context, key string, value any) error

func ExtractTagsFromText added in v0.17.0

func ExtractTagsFromText(text string) []string

func HashString added in v0.11.0

func HashString(s string) string

func Init

func Init()

func InitLogger added in v0.17.0

func InitLogger()

func RemoveAllInDir added in v0.20.7

func RemoveAllInDir(dirPath string) error

删除目录下的所有内容, 但不删除目录本身

func RmFileAfter added in v0.3.2

func RmFileAfter(path string, td time.Duration)

Types

This section is empty.

Jump to

Keyboard shortcuts

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