MCPcopy Create free account
hub / github.com/cel-expr/cel-go / ParsePolicyVariables

Function ParsePolicyVariables

tools/celtest/test_runner_test.go:131–137  ·  view source on GitHub ↗
(metadata map[string]any)

Source from the content-addressed store, hash-verified

129}
130
131func ParsePolicyVariables(metadata map[string]any) cel.EnvOption {
132 var variables []*decls.VariableDecl
133 for n, t := range metadata {
134 variables = append(variables, decls.NewVariable(n, parseCustomPolicyVariableType(t.(string))))
135 }
136 return cel.VariableDecls(variables...)
137}
138
139func parseCustomPolicyVariableType(t string) *types.Type {
140 switch t {

Callers

nothing calls this directly

Calls 3

NewVariableFunction · 0.92
VariableDeclsFunction · 0.92

Tested by

no test coverage detected