Help us shape the future of Go! Take the 2026 Go Developer Survey

policyquery

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, factory Factory)

Register adds the factory to the built-in policyQueryies map.

Types

type Config

type Config struct {
	Name   string
	Policy string
}

Config is a configuration for a policy query.

type Factory

type Factory interface {
	Create(policy string) (PolicyQuery, error)
}

Factory is an interface for creating policy queries.

type PolicyQuery

type PolicyQuery interface {
	// Evaluate evaluates the policy with the given input.
	// input is the verifier reports that query evaluates against.
	// result indicates whether the input satisfies the policy.
	// err indicates an error happened during the evaluation.
	Evaluate(ctx context.Context, input map[string]interface{}) (bool, error)
}

PolicyQuery is an interface with methods that make policy decisions.

func CreateQueryFromConfig

func CreateQueryFromConfig(queryConfig Config) (PolicyQuery, error)

CreateQueryFromConfig creates a policy query from the provided configuration.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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