open-vault/Godeps/_workspace/src/github.com/jmespath/go-jmespath/api.go

13 lines
334 B
Go
Raw Normal View History

2015-11-18 15:36:57 +00:00
package jmespath
// Search evaluates a JMESPath expression against input data and returns the result.
func Search(expression string, data interface{}) (interface{}, error) {
intr := newInterpreter()
parser := NewParser()
ast, err := parser.Parse(expression)
if err != nil {
return nil, err
}
return intr.Execute(ast, data)
}