util

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TdlLocation = "tdl"
)

Variables

This section is empty.

Functions

func Alarm added in v0.1.0

func Alarm(words ...string)

func CheckExactTime added in v0.1.0

func CheckExactTime(timeStr string)

CheckExactTime 检查是否到达指定的具体时间点 timeStr: 指定的时间字符串,格式为 "HH:MM:SS",例如 "08:30:00"

func CheckHour added in v0.1.0

func CheckHour(hour string)

CheckHour 检查当前时间是否到达指定小时 hour: 指定的小时数(24小时制) 当到达指定小时时返回 true

func Chown added in v0.0.7

func Chown(dir string, uid, gid int)

func CopyDir added in v0.1.0

func CopyDir(src string, dst string) error

CopyDir 递归复制目录

func CopyFile added in v0.1.0

func CopyFile(src, dst string) error

CopyFile 复制单个文件

func CountFiles added in v0.1.0

func CountFiles(dirPath string) (int, error)

统计指定目录下的文件数 相当于find . -type f | wc -l

func ExecCommand

func ExecCommand(c *exec.Cmd) (e error)

执行命令过程中可以循环打印消息

func ExecTdlCommand

func ExecTdlCommand(proxy, uri, target string) (e error)

执行tdl命令过程中可以循环打印消息

func FindLatestFileGo added in v0.0.30

func FindLatestFileGo(dir string) string

FindLatestFileGo 使用 Go 标准库在指定目录中查找最近创建或修改的文件 dir: 要搜索的目录路径 returns: 最新文件的绝对路径,如果出错则返回空字符串

func FindUniqueFile added in v0.0.4

func FindUniqueFile(dir string, searchStr string) (string, error)

func GenerateURL added in v0.0.11

func GenerateURL(baseURL string, offset int, tag string) error

func GetAllFileInfoFast

func GetAllFileInfoFast(dir, pattern string) ([]string, error)

func GetExpectedFilesToAdd added in v0.1.0

func GetExpectedFilesToAdd(urls []string) int

获取字符串数组理论上需要下载的条目数

func GetKey

func GetKey(s string) string

func GetPercentageSign

func GetPercentageSign(s string) int

func IsExistCmd

func IsExistCmd(cmds ...string) bool

func IsExistFile added in v0.0.24

func IsExistFile(filePath string) bool

IsExistFile 判断文件是否存在

func IsExistPath added in v0.0.24

func IsExistPath(folderPath string) bool

IsExistPath 判断文件夹是否存在

func ReadByLine

func ReadByLine(fp string) []string

func ReadInSlice

func ReadInSlice(fp string) []string

func RenameByKey added in v0.0.4

func RenameByKey(of constant.OneFile, p constant.Parameter)

func SetLog

func SetLog(l string)

func TimeoutAlert added in v0.1.0

func TimeoutAlert(msg string)

func WriteByLine

func WriteByLine(fp string, s []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