utils

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CSTLocation = time.FixedZone("CST", 8*3600)

CSTLocation is the China Standard Time timezone (UTC+8). All PT sites (M-Team, HDSky, SpringSunday, HDDolby, etc.) return times in CST.

Functions

func CheckDirectory

func CheckDirectory(path string) (exists, empty bool, err error)

CheckDirectory 检查目录是否存在且为空 返回值: - exists: 目录是否存在 - empty: 目录是否为空(如果存在) - err: 错误信息(如果存在)

func DirectoryExists

func DirectoryExists(path string) (bool, error)

func IsDirectoryEmpty

func IsDirectoryEmpty(path string) (bool, error)

func ParseTimeInCST added in v0.3.0

func ParseTimeInCST(layout, value string) (time.Time, error)

ParseTimeInCST parses a time string in CST timezone.

func ResolveDownloadBase added in v0.1.1

func ResolveDownloadBase(home, work, dir string) (string, error)

func SanitizeURL added in v0.6.0

func SanitizeURL(rawURL string) string

SanitizeURL 对 URL 中的敏感查询参数进行脱敏处理 返回脱敏后的 URL 字符串,敏感参数值会被替换为 "***" 如果解析失败,返回 "<invalid-url>"

func SubPathFromTag added in v0.1.1

func SubPathFromTag(tag string) string

Types

type Locker added in v0.0.14

type Locker interface {
	Lock() error
	Unlock() error
	File() *os.File
}

定义统一接口

func NewLocker added in v0.0.14

func NewLocker(lockPath string) (Locker, error)

Directories

Path Synopsis
Package httpclient 提供基于 github.com/sunerpy/requests 的 HTTP 客户端连接池管理
Package httpclient 提供基于 github.com/sunerpy/requests 的 HTTP 客户端连接池管理

Jump to

Keyboard shortcuts

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