provider

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNonDerivable = errors.New("data is non derivable")

Functions

func DeriveProperties

func DeriveProperties(deriver DataDeriver, namespace Namespace, data any) (map[string]any, error)

Types

type Builtin

type Builtin interface {
	Func() *rego.Function
	Impl(rego.BuiltinContext, []*ast.Term) (*ast.Term, error)
}

Builtin is represents a built-in function in the policy engine. It specifies the function signature and the function implementation.

type DataDeriver

type DataDeriver interface {
	DeriveNamespace(map[string]any) (Namespace, error)
	DeriveProperties(Namespace, map[string]any) (map[string]any, error)
}

DataDeriver is the interface that provides functions to derive a policy namespace and report properties from input data for a specific provider.

type Namespace

type Namespace string

func DeriveNamespace

func DeriveNamespace(deriver DataDeriver, data any) (Namespace, error)

type Provider

type Provider interface {
	DataDeriver

	Builtins() []Builtin
}

Provider is the interface that provides the functions required to work with a specific provider, namely a function to register built-in functions in the policy engine and functions to derive required information from input data. See DataDeriver.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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