utils

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CurrentVersion = "0.0.1"
	VersionHash    = "unknown"
)

Functions

func DataMasking

func DataMasking(str string, private []string) string

func GenerateRandomString

func GenerateRandomString(length int) string

func GenerateToken

func GenerateToken() string

func GetCallbackURL

func GetCallbackURL(c *gin.Context) string

func PingTasksFamilySkips added in v0.1.5

func PingTasksFamilySkips(pingTasks []models.PingTask) (map[uint][]string, error)

PingTasksFamilySkips 返回每个任务里会因地址族不匹配而被跳过的节点 UUID。

供管理界面标注:让用户看到"这个节点被跳过了",而不是只发现某条曲线没有数据。 与实际调度共用 filterClientsByTargetFamily,所以界面显示的和真正下发的不会分叉。

func ReloadPingSchedule

func ReloadPingSchedule(pingTasks []models.PingTask) error

ReloadPingSchedule 加载或重载时间表

func ValidatePingTaskTargetFamily added in v0.1.27

func ValidatePingTaskTargetFamily(target string, defaultOn bool, clientUUIDs []string) error

ValidatePingTaskTargetFamily 是给写入路径用的入口:先取一次节点地址族,再判断。

只查一次表:任务的探针数量是个位数,而这里只需要 uuid / name / ipv4 / ipv6 四列。 规则与理由见 checkPingTaskTargetFamily。

Types

type PingTaskManager

type PingTaskManager struct {
	// contains filtered or unexported fields
}

PingTaskManager 管理定时器和任务

func (*PingTaskManager) Reload

func (m *PingTaskManager) Reload(pingTasks []models.PingTask) error

Reload 重载时间表

Directories

Path Synopsis
Package logger provides the server's single runtime logging surface.
Package logger provides the server's single runtime logging surface.
outboundhttp
Package outboundhttp provides the HTTP client used by configurable notification senders.
Package outboundhttp provides the HTTP client used by configurable notification senders.
Package maintenance windows, for the notifier: it answers "should this alert be sent now, and if not, when" using the rules in internal/maintenance.
Package maintenance windows, for the notifier: it answers "should this alert be sent now, and if not, when" using the rules in internal/maintenance.

Jump to

Keyboard shortcuts

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