MCPcopy
hub / github.com/caddyserver/caddy / MatchExpression

Struct MatchExpression

modules/caddyhttp/celmatcher.go:61–77  ·  view source on GitHub ↗

MatchExpression matches requests by evaluating a [CEL](https://github.com/google/cel-spec) expression. This enables complex logic to be expressed using a comfortable, familiar syntax. Please refer to [the standard definitions of CEL functions and operators](https://github.com/google/cel-spec/blob/ma

Source from the content-addressed store, hash-verified

59// COMPATIBILITY NOTE: This module is still experimental and is not
60// subject to Caddy's compatibility guarantee.
61type MatchExpression struct {
62 // The CEL expression to evaluate. Any Caddy placeholders
63 // will be expanded and situated into proper CEL function
64 // calls before evaluating.
65 Expr string `json:"expr,omitempty"`
66
67 // Name is an optional name for this matcher.
68 // This is used to populate the name for regexp
69 // matchers that appear in the expression.
70 Name string `json:"name,omitempty"`
71
72 expandedExpr string
73 prg cel.Program
74 ta types.Adapter
75
76 log *zap.Logger
77}
78
79// CaddyModule returns the Caddy module information.
80func (MatchExpression) CaddyModule() caddy.ModuleInfo {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected