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

Function NewPolicy

policy/parser.go:36–44  ·  view source on GitHub ↗

NewPolicy creates a policy object which references a policy source and source information.

(src *Source, info *ast.SourceInfo)

Source from the content-addressed store, hash-verified

34
35// NewPolicy creates a policy object which references a policy source and source information.
36func NewPolicy(src *Source, info *ast.SourceInfo) *Policy {
37 return &Policy{
38 metadata: map[string]any{},
39 source: src,
40 info: info,
41 semantic: firstMatch,
42 imports: []*Import{},
43 }
44}
45
46// Policy declares a name, rule, and evaluation semantic for a given expression graph.
47type Policy struct {

Callers 1

NewPolicyMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected