Compiler interface is used to set up a compiler with the following capabilities: - create a CEL environment - create a policy parser - fetch policy compiler options - fetch policy environment options Note: This compiler is not the same as the CEL expression compiler, rather it provides an abstracti
| 91 | // abstraction layer which can create the different components needed for parsing and compiling CEL |
| 92 | // expressions and policies. |
| 93 | type Compiler interface { |
| 94 | // CreateEnv creates a singleton CEL environment with the configured environment options. |
| 95 | CreateEnv() (*cel.Env, error) |
| 96 | // CreatePolicyParser creates a policy parser using the optionally configured parser options. |
| 97 | CreatePolicyParser() (*policy.Parser, error) |
| 98 | // PolicyCompilerOptions returns the policy compiler options. |
| 99 | PolicyCompilerOptions() []policy.CompilerOption |
| 100 | } |
| 101 | |
| 102 | // CustomMetadataCompiler interface is used to set up a compiler with the following capabilities: |
| 103 | // - fetch policy metadata environment options |
no outgoing calls
no test coverage detected