Documentation ¶
Index ¶
- func AddPortsToFirewall(ports []int)
- func CeilUnixTime(seconds int) int64
- func ContainsStringInsensitive(list []string, search string) bool
- func DumpResponse(resp *http.Response) (header []byte, body []byte, err error)
- func EqualConfig(config1 any, config2 any) bool
- func FixMonthMaxDay(day string) (string, error)
- func FloorUnixTime(seconds int) int64
- func GMTTime(t time.Time) time.Time
- func GMTUnixTime(timestamp int64) int64
- func GroupMinuteRanges(minutes []timeDayMinute) []timeDayMinuteRange
- func IP2Long(ip string) uint64
- func IsIPv6(ip string) bool
- func JSONClone[T any](ptr T) (newPtr T, err error)
- func LastDayInMonth(month string) (string, error)
- func LimitString(s string, maxLength int) string
- func LookupCNAME(host string) (string, error)
- func LookupNS(host string) ([]string, error)
- func LookupTXT(host string) ([]string, error)
- func NewHTTPClient(timeout time.Duration) *http.Client
- func NextMinuteUnixTime() int64
- func ParseDomainFromKey(key string) (domain string)
- func PrintError(err error)
- func Range24HourTimes(everyMinutes int32) ([]string, error)
- func RangeDays(dayFrom string, dayTo string) ([]string, error)
- func RangeHours(hourFrom string, hourTo string) ([]string, error)
- func RangeMinutes(toTime time.Time, count int, everyMinutes int32) []timeDayMinute
- func RangeMonths(dayFrom string, dayTo string) ([]string, error)
- func RangeTimes(timeFrom string, timeTo string, everyMinutes int32) (result []string, err error)
- func SetRLimit(limit uint64) error
- func SetSuitableRLimit()
- func Sha1RandomString() string
- func SharedHttpClient(timeout time.Duration) *http.Client
- func Similar(s1 string, s2 string) float32
- func SplitKeywordArgs(s string) (args []splitArg)
- func SplitStrings(s string, glue string) []string
- func SystemMemoryGB() int
- func UnixTime() int64
- func UnixTimeMilli() int64
- func UnixTimeMilliString() (int64, string)
- func ValidateEmail(email string) bool
- func VersionToLong(version string) uint32
- type CacheMap
- type Progress
- type ServiceManager
- func (this *ServiceManager) Close() error
- func (this *ServiceManager) Install(exePath string, args []string) error
- func (this *ServiceManager) Log(msg string)
- func (this *ServiceManager) LogError(msg string)
- func (this *ServiceManager) PauseWindow()
- func (this *ServiceManager) Start() error
- func (this *ServiceManager) Uninstall() error
- type Ticker
- type Unzip
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddPortsToFirewall ¶
func AddPortsToFirewall(ports []int)
func ContainsStringInsensitive ¶
ContainsStringInsensitive 检查是否包含某个字符串,并且不区分大小写
func DumpResponse ¶
DumpResponse 导出响应
func EqualConfig ¶ added in v0.5.3
EqualConfig 使用JSON对比配置
func FixMonthMaxDay ¶ added in v0.5.6
FixMonthMaxDay 修正日期最大值
func GroupMinuteRanges ¶ added in v0.4.9
func GroupMinuteRanges(minutes []timeDayMinute) []timeDayMinuteRange
GroupMinuteRanges 将时间点分组
func LastDayInMonth ¶ added in v0.5.6
LastDayInMonth 某月的最后一天 month: YYYYMM 返回 YYYYMMDD
func LimitString ¶ added in v0.5.2
LimitString 限制字符串长度
func LookupCNAME ¶ added in v0.5.3
LookupCNAME 查询CNAME记录 TODO 可以设置使用的DNS主机地址
func NewHTTPClient ¶
NewHTTPClient 获取一个新的Client
func NextMinuteUnixTime ¶ added in v0.5.6
func NextMinuteUnixTime() int64
NextMinuteUnixTime 获取下一分钟开始的时间戳
func ParseDomainFromKey ¶
ParseDomainFromKey 从Key中获取域名
func Range24HourTimes ¶ added in v0.5.6
Range24HourTimes 计算24小时时间点 从 00:00 - 23:59
func RangeHours ¶
RangeHours 计算小时之间的所有小时,格式为YYYYMMDDHH
func RangeMinutes ¶ added in v0.4.9
RangeMinutes 计算若干个时间点,返回结果为 [ [day1, minute1], [day2, minute2] ... ]
func RangeMonths ¶
RangeMonths 计算日期之间的所有月份,格式为YYYYMM
func RangeTimes ¶ added in v0.5.6
RangeTimes 计算时间点
func Sha1RandomString ¶ added in v0.4.9
func Sha1RandomString() string
func SharedHttpClient ¶
SharedHttpClient 获取一个公用的Client
func SplitKeywordArgs ¶ added in v1.0.0
func SplitKeywordArgs(s string) (args []splitArg)
SplitKeywordArgs 分隔关键词参数 支持:hello, "hello", name:hello, name:"hello", name:\"hello\"
func SystemMemoryGB ¶ added in v0.4.9
func SystemMemoryGB() int
func UnixTimeMilliString ¶ added in v0.5.6
Types ¶
type CacheMap ¶
type CacheMap struct {
// contains filtered or unexported fields
}
func NewCacheMap ¶
func NewCacheMap() *CacheMap
type ServiceManager ¶
type ServiceManager struct { Name string Description string // contains filtered or unexported fields }
服务管理器