Documentation ¶
Index ¶
- Constants
- Variables
- type Engine
- func (e *Engine) CompileRegoFiles() error
- func (e *Engine) Configure() error
- func (e *Engine) Evaluate(engineInput policy.EngineInput, filter policy.PreScanFilter) (policy.EngineOutput, error)
- func (e *Engine) GetResults() policy.EngineOutput
- func (e *Engine) Init(policyPath string, filter policy.PreLoadFilter) error
- func (e *Engine) LoadRegoFiles(policyPath string, filter policy.PreLoadFilter) error
- func (e *Engine) LoadRegoMetadata(metaFilename string) (*policy.RegoMetadata, error)
- func (e *Engine) Release() error
- type EngineStats
Constants ¶
View Source
const ( // RegoMetadataFileSuffix Suffix for files containing rego metadata RegoMetadataFileSuffix = ".json" // RuleQueryBase Default package to query RuleQueryBase = "data.accurics" )
Variables ¶
View Source
var ( // ErrInitFailed error ErrInitFailed = fmt.Errorf("failed to initialize OPA policy engine") )
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine Implements the policy engine interface
func (*Engine) CompileRegoFiles ¶
CompileRegoFiles Compiles rego files for faster evaluation
func (*Engine) Evaluate ¶
func (e *Engine) Evaluate(engineInput policy.EngineInput, filter policy.PreScanFilter) (policy.EngineOutput, error)
Evaluate Executes compiled OPA queries against the input JSON data
func (*Engine) GetResults ¶
func (e *Engine) GetResults() policy.EngineOutput
GetResults Fetches results from OPA engine policy evaluation
func (*Engine) Init ¶
func (e *Engine) Init(policyPath string, filter policy.PreLoadFilter) error
Init initializes the Opa engine Handles loading all rules, filtering, compiling, and preparing for evaluation
func (*Engine) LoadRegoFiles ¶
func (e *Engine) LoadRegoFiles(policyPath string, filter policy.PreLoadFilter) error
LoadRegoFiles Loads all related rego files from the given policy path into memory
func (*Engine) LoadRegoMetadata ¶
func (e *Engine) LoadRegoMetadata(metaFilename string) (*policy.RegoMetadata, error)
LoadRegoMetadata Loads rego metadata from a given file
type EngineStats ¶
type EngineStats struct {
// contains filtered or unexported fields
}
EngineStats Contains misc stats
Click to show internal directories.
Click to hide internal directories.