policies

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivePolicies

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

ActivePolicies implements PolicyManager interface.

func (*ActivePolicies) AddPolicy

func (p *ActivePolicies) AddPolicy(scope, policyName string, policy policyprovider.PolicyProvider)

AddPolicy fulfills the PolicyManager interface. It adds the given policy under the given scope.

func (*ActivePolicies) DeletePolicy

func (p *ActivePolicies) DeletePolicy(scope, policyName string)

DeletePolicy fulfills the PolicyManager interface. It deletes the policy from the given scope.

func (*ActivePolicies) GetPolicy

func (p *ActivePolicies) GetPolicy(scope string) policyprovider.PolicyProvider

GetPolicy fulfills the PolicyManager interface. It returns the policy for the given scope. If no policy is found for the given scope, it returns cluster-wide policy.

type PolicyManager

type PolicyManager interface {
	// GetPolicy returns the policy for the given scope.
	GetPolicy(scope string) policyprovider.PolicyProvider

	// AddPolicy adds the given policy under the given scope.
	AddPolicy(scope, policyName string, policy policyprovider.PolicyProvider)

	// DeletePolicy deletes the policy from the given scope.
	DeletePolicy(scope, policyName string)
}

PolicyManager is an interface that defines the methods for managing policies across different scopes.

func NewActivePolicies

func NewActivePolicies() PolicyManager

type PolicyWrapper

type PolicyWrapper struct {
	Name   string
	Policy policyprovider.PolicyProvider
}

PolicyWrapper wraps policy provider with its policy name.

Jump to

Keyboard shortcuts

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