policy

package
v0.52.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine added in v0.21.0

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

Engine represents the policy engine.

func Load added in v0.22.0

func Load(policyPaths []string, c compilerOptions) (*Engine, error)

Load returns an Engine after loading all of the specified policies.

func LoadWithData added in v0.22.0

func LoadWithData(policyPaths []string, dataPaths []string, capabilities string, strict bool) (*Engine, error)

LoadWithData returns an Engine after loading all of the specified policies and data paths.

func (*Engine) Check added in v0.22.0

func (e *Engine) Check(ctx context.Context, configs map[string]interface{}, namespace string) ([]output.CheckResult, error)

Check executes all of the loaded policies against the input and returns the results.

func (*Engine) CheckCombined added in v0.22.0

func (e *Engine) CheckCombined(ctx context.Context, configs map[string]interface{}, namespace string) (output.CheckResult, error)

CheckCombined combines the input and evaluates the policies against the combined result.

func (*Engine) Compiler added in v0.21.0

func (e *Engine) Compiler() *ast.Compiler

Compiler returns the compiler from the loaded policies.

func (*Engine) Documents added in v0.22.0

func (e *Engine) Documents() map[string]string

Documents returns all of the documents loaded into the engine. The result is a map where the key is the filepath of the document and its value is the raw contents of the loaded document.

func (*Engine) EnableTracing added in v0.25.0

func (e *Engine) EnableTracing()

func (*Engine) Modules added in v0.22.0

func (e *Engine) Modules() map[string]*ast.Module

Modules returns the modules from the loaded policies.

func (*Engine) Namespaces added in v0.22.0

func (e *Engine) Namespaces() []string

Namespaces returns all of the namespaces in the engine.

func (*Engine) Policies added in v0.22.0

func (e *Engine) Policies() map[string]string

Policies returns all of the policies loaded into the engine. The result is a map where the key is the filepath of the policy and its value is the raw contents of the loaded policy.

func (*Engine) Runtime added in v0.22.0

func (e *Engine) Runtime() *ast.Term

Runtime returns the runtime of the engine.

func (*Engine) ShowBuiltinErrors added in v0.46.0

func (e *Engine) ShowBuiltinErrors()

func (*Engine) Store added in v0.21.0

func (e *Engine) Store() storage.Store

Store returns the store from the loaded documents.

Jump to

Keyboard shortcuts

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