Search evaluates a JMESPath expression against input data and returns the result.
(expression string, data interface{})
| 39 | |
| 40 | // Search evaluates a JMESPath expression against input data and returns the result. |
| 41 | func Search(expression string, data interface{}) (interface{}, error) { |
| 42 | intr := newInterpreter() |
| 43 | parser := NewParser() |
| 44 | ast, err := parser.Parse(expression) |
| 45 | if err != nil { |
| 46 | return nil, err |
| 47 | } |
| 48 | return intr.Execute(ast, data) |
| 49 | } |
searching dependent graphs…