MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / Foreach

Struct Foreach

pkg/filter/ql/function.go:158–158  ·  view source on GitHub ↗

Foreach adds iteration capabilities to the rule language. The decision to keep the function implementation outside the functions package is deliberate. The function mostly operates with raw expressions, and if the function lived in the functions package, that would create a cyclic import and likely

Source from the content-addressed store, hash-verified

156// foreach(ps._ancestors, $proc, $proc.name = 'services.exe' and ps.is_protected, ps.is_protected)
157// In this example, the ps.is_protected field is captured prior to its usage in the predicate
158type Foreach struct{}
159
160func (f *Foreach) Call(args []interface{}) (interface{}, bool) {
161 if len(args) < 3 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected