enforcer

package
v0.1.0-alpha.30 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package enforcer defines policy enforcement.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conform

type Conform struct {
	Policies []*PolicyDeclaration `yaml:"policies"`
	// contains filtered or unexported fields
}

Conform is a struct that conform.yaml gets decoded into.

func New

func New(r string) (*Conform, error)

New loads the conform.yaml file and unmarshals it into a Conform struct.

func (*Conform) Enforce

func (c *Conform) Enforce(setters ...policy.Option) error

Enforce enforces all policies defined in the conform.yaml file.

type PolicyDeclaration

type PolicyDeclaration struct {
	Type string      `yaml:"type"`
	Spec interface{} `yaml:"spec"`
}

PolicyDeclaration allows a user to declare an arbitrary type along with a spec that will be decoded into the appropriate concrete type.

Jump to

Keyboard shortcuts

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