MCPcopy Index your code
hub / github.com/crowdsecurity/crowdsec / opContains

Function opContains

pkg/exprhelpers/debugger.go:353–365  ·  view source on GitHub ↗
(out OpOutput, _ *OpOutput, _ int, _ []string, vm *vm.VM, _ *vm.Program)

Source from the content-addressed store, hash-verified

351}
352
353func opContains(out OpOutput, _ *OpOutput, _ int, _ []string, vm *vm.VM, _ *vm.Program) *OpOutput {
354 // kind of OpIn, but reverse
355 stack := vm.Stack
356 out.Condition = true
357 out.ConditionContains = true
358 // it seems that we tend to receive stack[1] as a map.
359 // it is tempting to use reflect to extract keys, but we end up with an array that doesn't match the initial order
360 // (because of the random order of the map)
361 out.Args = append(out.Args, autoQuote(stack[0]))
362 out.Args = append(out.Args, autoQuote(stack[1]))
363
364 return &out
365}
366
367func (erp ExprRuntimeDebug) ipDebug(ip int, vm *vm.VM, program *vm.Program, parts []string, outputs []OpOutput) []OpOutput {
368 IdxOut := len(outputs)

Callers

nothing calls this directly

Calls 1

autoQuoteFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…