Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RegisteredEnums = []EnumRegistration{ { Name: "ProjectSourceType", Prefix: "PROJECT_SOURCE_TYPE_", ValueMap: packagev1.ProjectSourceType_value, }, { Name: "Ecosystem", Prefix: "ECOSYSTEM_", ValueMap: packagev1.Ecosystem_value, }, }
RegisteredEnums contains all enum types that should be exposed to CEL Uses the protobuf-generated Type_value maps to avoid manual maintenance and drift
Functions ¶
func NewEvaluator ¶
NewEvaluator creates a new CEL evaluator for the policy system v2
Types ¶
type EnumRegistration ¶
type EnumRegistration struct {
Name string // Name used in CEL expressions (e.g., "ProjectSourceType")
Prefix string // Common prefix to strip from constant names
ValueMap map[string]int32 // Reference to protobuf-generated enum value map
}
EnumRegistration contains all the information needed to generate enum constants
type Evaluator ¶
type Evaluator interface {
// AddPolicy adds a policy to the evaluator
AddPolicy(policy *policyv1.Policy) error
// EvaluatePackage evaluates a package against the policies
EvaluatePackage(pkg *models.Package) (*FilterEvaluationResult, error)
}
Evaluator interface for the new policy system using Insights v2 data model
type FilterEvaluationResult ¶
type FilterEvaluationResult struct {
// contains filtered or unexported fields
}
FilterEvaluationResult represents the result of evaluating a filter
func (*FilterEvaluationResult) GetMatchedProgram ¶
func (r *FilterEvaluationResult) GetMatchedProgram() (*FilterProgram, error)
func (*FilterEvaluationResult) Matched ¶
func (r *FilterEvaluationResult) Matched() bool
type FilterProgram ¶
type FilterProgram struct {
// contains filtered or unexported fields
}
FilterProgram holds a rule and its compiled CEL program for fast evaluation of the expression
func (*FilterProgram) GetPolicy ¶
func (p *FilterProgram) GetPolicy() *policyv1.Policy
func (*FilterProgram) GetRule ¶
func (p *FilterProgram) GetRule() *policyv1.Rule
func (*FilterProgram) Name ¶
func (p *FilterProgram) Name() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.