policy

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package policy handles policy matching and evaluation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EvaluationResult

type EvaluationResult struct {
	Violations []domain.Violation
	Passed     bool // True if no error/critical violations
}

EvaluationResult holds the outcome of evaluating rules against evidence.

func Evaluate

func Evaluate(rules []domain.PolicyRule, ev []domain.Evidence, unitPath string) EvaluationResult

Evaluate checks policy rules against collected evidence. unitPath is the file path of the unit being evaluated, used for rule-level path filtering (PathPatterns/ExcludePatterns).

type Matcher

type Matcher struct {
	// contains filtered or unexported fields
}

Matcher determines which policy packs apply to a given unit.

func NewMatcher

func NewMatcher(packs []domain.PolicyPack) *Matcher

NewMatcher creates a new policy matcher.

func (*Matcher) Match

func (m *Matcher) Match(unit domain.Unit) []domain.PolicyPack

Match returns the policy packs that apply to the given unit.

func (*Matcher) Packs added in v0.2.0

func (m *Matcher) Packs() []domain.PolicyPack

Packs returns all loaded policy packs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL