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

Function isCELCaddyPlaceholderCall

modules/caddyhttp/celmatcher.go:753–764  ·  view source on GitHub ↗

isCELCaddyPlaceholderCall returns whether the expression is a caddy placeholder call.

(e ast.Expr)

Source from the content-addressed store, hash-verified

751
752// isCELCaddyPlaceholderCall returns whether the expression is a caddy placeholder call.
753func isCELCaddyPlaceholderCall(e ast.Expr) bool {
754 switch e.Kind() {
755 case ast.CallKind:
756 call := e.AsCall()
757 if call.FunctionName() == CELPlaceholderFuncName {
758 return true
759 }
760 case ast.UnspecifiedExprKind, ast.ComprehensionKind, ast.IdentKind, ast.ListKind, ast.LiteralKind, ast.MapKind, ast.SelectKind, ast.StructKind:
761 // appeasing the linter :)
762 }
763 return false
764}
765
766// isCELConcatCall tests whether the expression is a concat function (+) with string, placeholder, or
767// other concat call arguments.

Callers 1

isCELStringExprFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected