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

Method EvalExpression

pkg/hubtest/parser_assert.go:199–211  ·  view source on GitHub ↗
(expression string)

Source from the content-addressed store, hash-verified

197}
198
199func (p *ParserAssert) EvalExpression(expression string) (string, error) {
200 output, err := p.RunExpression(expression)
201 if err != nil {
202 return "", err
203 }
204
205 ret, err := yaml.Marshal(output)
206 if err != nil {
207 return "", err
208 }
209
210 return string(ret), nil
211}
212
213func (p *ParserAssert) Run(assert string) (bool, error) {
214 output, err := p.RunExpression(assert)

Callers 2

AssertFileMethod · 0.95
newEvalCmdMethod · 0.45

Calls 1

RunExpressionMethod · 0.95

Tested by

no test coverage detected