policy

package
v0.0.0-...-b3aaee5 Latest Latest
Warning

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

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

Documentation

Overview

Copyright 2022 VMware, Inc. SPDX-License-Identifier: Apache-2.0

Copyright 2022 VMware, Inc. SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Enforcer

type Enforcer interface {
	// Enforce policy to the specified workload with options.
	Enforce(ctx context.Context, workload *rcworkload.Workload, option ...enforcement.Option) error
	// Revoke policy from the specified workload.
	Revoke(ctx context.Context, workload *rcworkload.Workload) error
	// HasBeenEnforced checks if the workload is managed by the policy.
	HasBeenEnforced(ctx context.Context, workload *rcworkload.Workload) (bool, error)
}

Enforcer to enforce policy.

func GetEnforcer

func GetEnforcer(name string, option ...EnforcerOption) (Enforcer, error)

GetEnforcer returns enforcer by name. Optional options provided.

func NewNetworkPolicyEnforcer

func NewNetworkPolicyEnforcer(option ...EnforcerOption) (Enforcer, error)

NewNetworkPolicyEnforcer is constructor of network policy enforcer.

type EnforcerOption

type EnforcerOption func(options *EnforcerOptions)

EnforcerOption defines option for the enforcer.

func UseClient

func UseClient(cli client.Client) EnforcerOption

UseClient uses the k8s client.

func WithScheme

func WithScheme(scheme *runtime.Scheme) EnforcerOption

WithScheme sets what scheme will use.

type EnforcerOptions

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

EnforcerOptions defines options for the enforcer.

func (*EnforcerOptions) From

func (eo *EnforcerOptions) From(option ...EnforcerOption)

From options.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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