worker

package
v0.0.187 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package watcher 实现规则匹配器

Package worker 实现事件处理Worker

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventWorker

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

EventWorker 事件处理Worker

func Instance

func Instance() *EventWorker

Instance 获取全局事件处理Worker实例 中文函数注释:用于控制器在保存配置后调用刷新方法。

func NewEventWorker

func NewEventWorker() *EventWorker

NewEventWorker 创建事件处理Worker

func (*EventWorker) Start

func (w *EventWorker) Start()

Start 启动Worker

func (*EventWorker) Stop

func (w *EventWorker) Stop()

Stop 停止Worker

func (*EventWorker) UpdateConfig

func (w *EventWorker) UpdateConfig()

UpdateConfig 动态刷新事件处理配置(从数据库重新加载) 中文函数注释:用于在管理界面更新事件规则或Webhook后,立即让Worker生效,无需重启。

type RuleMatcher

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

RuleMatcher 规则匹配器(支持按集群匹配)

func NewRuleMatcher

func NewRuleMatcher(rules map[string]config.RuleConfig) *RuleMatcher

NewRuleMatcher 创建规则匹配器(按集群规则)

func (*RuleMatcher) Match

func (r *RuleMatcher) Match(event *models.K8sEvent) bool

Match 判断事件是否匹配对应集群规则

func (*RuleMatcher) UpdateRules

func (r *RuleMatcher) UpdateRules(rules map[string]config.RuleConfig)

UpdateRules 更新整套规则

Jump to

Keyboard shortcuts

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