utils

package
v0.0.0-...-5ea143f Latest Latest
Warning

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

Go to latest
Published: Nov 18, 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

View Source
const DefaultResetTimezone = "Asia/Shanghai"

Variables

This section is empty.

Functions

func ConvertIDNToASCII

func ConvertIDNToASCII(urlStr string) (string, error)

ConvertIDNToASCII 将包含国际化域名(IDN)的 URL 转换为 ASCII 兼容编码(ACE)格式 例如: "https://中文域名.com" -> "https://xn--fiq228c.com"

func GetLastResetDate

func GetLastResetDate(resetDay int, currentDate time.Time) time.Time

GetLastResetDate 计算上一个重置日期(北京时间当天 0:00)。

func GetLastResetInstant

func GetLastResetInstant(resetDay int, clock, timezone string, currentDate time.Time) time.Time

GetLastResetInstant 按指定时区与时刻计算上一次流量重置。 时区或时刻为空时与 Lite 存量升级一致:Asia/Shanghai + 00:00:00。

func ParseResetClock

func ParseResetClock(value string) (hour, minute, second int, err error)

func ResetLocation

func ResetLocation(name string) *time.Location

Types

This section is empty.

Jump to

Keyboard shortcuts

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