(f *config.FilterConfig, evts ...*event.Event)
| 308 | } |
| 309 | |
| 310 | func (e *Engine) appendMatch(f *config.FilterConfig, evts ...*event.Event) { |
| 311 | for _, evt := range evts { |
| 312 | evt.AddMeta(event.RuleNameKey, f.Name) |
| 313 | for k, v := range f.Labels { |
| 314 | evt.AddMeta(event.MetadataKey(k), v) |
| 315 | } |
| 316 | } |
| 317 | ctx := &config.ActionContext{ |
| 318 | Events: evts, |
| 319 | Filter: f, |
| 320 | } |
| 321 | e.mmu.Lock() |
| 322 | defer e.mmu.Unlock() |
| 323 | e.matches = append(e.matches, &ruleMatch{ctx: ctx}) |
| 324 | if e.matchFunc != nil { |
| 325 | e.matchFunc(f, evts...) |
| 326 | } |
| 327 | } |
| 328 | |
| 329 | func (e *Engine) clearMatches() { |
| 330 | e.mmu.Lock() |
no test coverage detected