policy

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

func Load

func Load(ctx context.Context, policyPaths []string, opts ...Option) (*Engine, error)

func (*Engine) Check

func (e *Engine) Check(ctx context.Context, namespace string, input interface{}) (output.Report, error)

func (*Engine) Compiler

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

Compiler returns the compiler from the loaded policies.

func (*Engine) Modules

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

Modules returns the modules from the loaded policies.

func (*Engine) Namespaces

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

Namespaces returns all of the namespaces in the engine.

type ErrNoPolicies added in v0.6.0

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

func (*ErrNoPolicies) Error added in v0.6.0

func (e *ErrNoPolicies) Error() string

type ErrPolicyLoad added in v0.6.0

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

func (*ErrPolicyLoad) Error added in v0.6.0

func (e *ErrPolicyLoad) Error() string

type Option added in v0.6.0

type Option func(*Engine)

func WithTracingEnabled added in v0.6.0

func WithTracingEnabled(enabled bool) Option

WithTracingEnabled enables or disables policy execution tracing.

Jump to

Keyboard shortcuts

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