mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-07 00:17:13 +00:00
19 lines
297 B
Go
19 lines
297 B
Go
|
package jmespath
|
||
|
|
||
|
import (
|
||
|
gojmespath "github.com/jmespath/go-jmespath"
|
||
|
)
|
||
|
|
||
|
func New(query string) (*gojmespath.JMESPath, error) {
|
||
|
jp, err := gojmespath.Compile(query)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
|
||
|
for _, function := range getFunctions() {
|
||
|
jp.Register(function)
|
||
|
}
|
||
|
|
||
|
return jp, nil
|
||
|
}
|