Documentation
¶
Index ¶
- func DefaultHTTPClient() *http.Client
- func NeedsCELCompat(s string) bool
- func ParseValidationEnvAllowlist(parts []string) map[string]struct{}
- func RewriteCELCompat(input string) (string, error)
- type EvalOptions
- type EvalResult
- type Program
- type Runtime
- func (e *Runtime) CompileFilter(expression string, tokenizer *tiktoken.Tiktoken) (Program, error)
- func (e *Runtime) CompilePrefilter(expression string) (Program, error)
- func (e *Runtime) CompileValidation(expression string) (Program, error)
- func (e *Runtime) Eval(prg Program, finding, captures map[string]string) (any, error)
- func (e *Runtime) EvalFilter(prg Program, finding, attributes map[string]string) (bool, error)
- func (e *Runtime) EvalPrefilter(prg Program, attributes map[string]string) (bool, error)
- func (e *Runtime) EvalValidation(ctx context.Context, prg Program, ...) (EvalResult, error)
- func (e *Runtime) EvalWithAttributes(prg Program, finding, captures, attributes map[string]string) (any, error)
- func (e *Runtime) EvalWithContext(ctx context.Context, prg Program, ...) (any, error)
- func (e *Runtime) SetHTTPClient(c *http.Client)
- func (e *Runtime) SetTokenizerProvider(provider func() *tiktoken.Tiktoken)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultHTTPClient ¶
DefaultHTTPClient returns an HTTP client with reasonable timeouts.
func NeedsCELCompat ¶
func ParseValidationEnvAllowlist ¶
ParseValidationEnvAllowlist converts CLI flag fragments into a set of names.
func RewriteCELCompat ¶
RewriteCELCompat rewrites the CEL-shaped expression syntax used by existing configs into Expr syntax. It is intentionally narrow; unsupported CEL syntax should fail at Expr compile with both original and rewritten expressions.
Types ¶
type EvalOptions ¶
type EvalOptions struct {
Debug bool
}
type EvalResult ¶
type Program ¶
type Program = *compiledProgram
Program is the compiled expression representation used by validation, filters, and prefilters.
type Runtime ¶
type Runtime struct {
STSEndpoint string
GCPTokenEndpoint string
AllowedEnv map[string]struct{}
// contains filtered or unexported fields
}
Runtime holds compiled Expr programs and validation services (if needed).
func (*Runtime) CompileFilter ¶
func (*Runtime) CompilePrefilter ¶
func (*Runtime) CompileValidation ¶
func (*Runtime) EvalFilter ¶
Compile and runtime bindings expose the same names. Dynamic values are layered onto a shallow copy so compiled programs can share static function bindings.
func (*Runtime) EvalPrefilter ¶
func (*Runtime) EvalValidation ¶
func (e *Runtime) EvalValidation(ctx context.Context, prg Program, finding, captures, attributes map[string]string, opts EvalOptions) (EvalResult, error)