v1beta1

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metadata

type Metadata struct {
	Name        string            `yaml:"name"`
	Annotations map[string]string `yaml:"annotations"`
}

type PolicyFile

type PolicyFile struct {
	APIVersion string     `yaml:"apiVersion"`
	Kind       string     `yaml:"kind"`
	Metadata   Metadata   `yaml:"metadata"`
	Spec       PolicySpec `yaml:"spec"`
}

PolicyFile is the structure of the policy file

func PoliciesFromPaths

func PoliciesFromPaths(paths []string) ([]PolicyFile, error)

PoliciesFromPaths returns a slice of policies from the given paths

func (PolicyFile) DefaultActions

func (p PolicyFile) DefaultActions() []string

func (PolicyFile) Description

func (p PolicyFile) Description() string

func (PolicyFile) Name

func (p PolicyFile) Name() string

func (PolicyFile) Rules

func (p PolicyFile) Rules() []Rule

func (PolicyFile) Scope

func (p PolicyFile) Scope() []string

func (PolicyFile) Validate

func (p PolicyFile) Validate() error

type PolicySpec

type PolicySpec struct {
	Scope          []string `yaml:"scope"`
	DefaultActions []string `yaml:"defaultActions"`
	Rules          []Rule   `yaml:"rules"`
}

type Rule

type Rule struct {
	Event   string   `yaml:"event"`
	Filters []string `yaml:"filters"`
	Actions []string `yaml:"actions"`
}

Rule is the structure of the rule in the policy file

Jump to

Keyboard shortcuts

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