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 (*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 更新整套规则
Click to show internal directories.
Click to hide internal directories.