Documentation
¶
Index ¶
- Variables
- func DataMasking(str string, private []string) string
- func GenerateRandomString(length int) string
- func GenerateToken() string
- func GetCallbackURL(c *gin.Context) string
- func GetScheme(c *gin.Context) string
- func PingTasksFamilySkips(pingTasks []models.PingTask) (map[uint][]string, error)
- func ReloadPingSchedule(pingTasks []models.PingTask) error
- func ValidatePingTaskTargetFamily(target string, defaultOn bool, clientUUIDs []string) error
- func ValidatePingTaskTargetFamilyWithDB(db *gorm.DB, target string, defaultOn bool, clientUUIDs []string) error
- func ValidatePinnedPingInterval(interval int) error
- func ValidatePinnedPingTarget(target, kind, family string) error
- type PingTaskManager
Constants ¶
This section is empty.
Variables ¶
var ( CurrentVersion = "0.0.1" VersionHash = "unknown" )
Functions ¶
func DataMasking ¶
func GenerateRandomString ¶
func GenerateToken ¶
func GenerateToken() string
func GetCallbackURL ¶
func GetScheme ¶
https://github.com/labstack/echo/blob/98ca08e7dd64075b858e758d6693bf9799340756/context.go#L275-L294
func PingTasksFamilySkips ¶ added in v0.1.5
PingTasksFamilySkips 返回每个任务里会因地址族不匹配而被跳过的节点 UUID。
供管理界面标注:让用户看到"这个节点被跳过了",而不是只发现某条曲线没有数据。 与实际调度共用 filterClientsByTargetFamily,所以界面显示的和真正下发的不会分叉。
func ReloadPingSchedule ¶
ReloadPingSchedule 加载或重载时间表
func ValidatePingTaskTargetFamily ¶ added in v0.1.27
ValidatePingTaskTargetFamily 是给写入路径用的入口:先取一次节点地址族,再判断。
只查一次表:任务的探针数量是个位数,而这里只需要 uuid / name / ipv4 / ipv6 四列。 规则与理由见 checkPingTaskTargetFamily。
func ValidatePingTaskTargetFamilyWithDB ¶ added in v1.7.30
func ValidatePingTaskTargetFamilyWithDB(db *gorm.DB, target string, defaultOn bool, clientUUIDs []string) error
ValidatePingTaskTargetFamilyWithDB lets task mutations validate within the same transaction that reads the current task. It deliberately does not resolve hostnames on the panel.
func ValidatePinnedPingInterval ¶ added in v1.7.30
ValidatePinnedPingInterval prevents overflowing the scheduler's duration.
func ValidatePinnedPingTarget ¶ added in v1.7.30
ValidatePinnedPingTarget rejects an invalid explicit family or a literal in the wrong family without resolving DNS on the panel. Agents resolve the hostname themselves on every probe.
Types ¶
type PingTaskManager ¶
type PingTaskManager struct {
// contains filtered or unexported fields
}
PingTaskManager 管理定时器和任务
func NewPingTaskManagerWithScheduler ¶ added in v1.7.30
func NewPingTaskManagerWithScheduler(s *scheduler.Manager, pinned func(context.Context, string, models.PingTask) error) *PingTaskManager
NewPingTaskManagerWithScheduler creates an isolated schedule with an explicitly supplied dispatcher.
func (*PingTaskManager) Reload ¶
func (m *PingTaskManager) Reload(pingTasks []models.PingTask) error
Reload 重载时间表
func (*PingTaskManager) Stop ¶ added in v1.7.30
func (m *PingTaskManager) Stop()
Stop cancels future firings and in-flight work for this manager's scheduler.
Source Files
¶
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. |