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

Method Run

pkg/hubtest/parser_assert.go:213–225  ·  view source on GitHub ↗
(assert string)

Source from the content-addressed store, hash-verified

211}
212
213func (p *ParserAssert) Run(assert string) (bool, error) {
214 output, err := p.RunExpression(assert)
215 if err != nil {
216 return false, err
217 }
218
219 switch out := output.(type) {
220 case bool:
221 return out, nil
222 default:
223 return false, fmt.Errorf("assertion '%s' is not a condition", assert)
224 }
225}
226
227func Escape(val string) string {
228 val = strings.ReplaceAll(val, `\`, `\\`)

Callers 1

AssertFileMethod · 0.95

Calls 1

RunExpressionMethod · 0.95

Tested by

no test coverage detected