utils

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SubName    = "sub"
	MihomoName = "mihomo"
)

Variables

View Source
var BaseURL string

基础URL配置

Functions

func ExecuteCallback

func ExecuteCallback(successCount int)

ExecuteCallback 执行回调脚本

func GetCurrentTime

func GetCurrentTime() string

func GetExecutablePath

func GetExecutablePath() string

func Notify

func Notify(request NotifyRequest) error

Notify 发送通知

func SendNotify

func SendNotify(length int)

func SetupSignalHandler

func SetupSignalHandler(forceClose *atomic.Bool)

SetupSignalHandler 设置信号处理 同时支持两种信号处理模式: - HUB 信号(SIGHUP): 只设置 check.ForceClose 为 true,不退出程序 - Ctrl+C 信号(SIGINT/SIGTERM): 第一次设置 ForceClose,第二次退出程序

func UpdateSubStore

func UpdateSubStore(yamlData []byte)

func UpdateSubs

func UpdateSubs()

func WarpUrl

func WarpUrl(url string) string

Types

type NotifyRequest

type NotifyRequest struct {
	URLs  string `json:"urls"`  // 通知目标的 URL(如 mailto://、discord://)
	Body  string `json:"body"`  // 通知内容
	Title string `json:"title"` // 通知标题(可选)
}

NotifyRequest 定义发送通知的请求结构

type Operator

type Operator struct {
	Args     args   `json:"args"`
	Disabled bool   `json:"disabled"`
	Type     string `json:"type"`
}

Jump to

Keyboard shortcuts

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