toggle

package
v1.12.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// protect managed resource
	ProtectManagedResourcesFlagName    = "protectManagedResources"
	ProtectManagedResourcesDescription = "Set the flag to 'true', to enable managed resources protection."

	// force failure policy ignore
	ForceFailurePolicyIgnoreFlagName    = "forceFailurePolicyIgnore"
	ForceFailurePolicyIgnoreDescription = "Set the flag to 'true', to force set Failure Policy to 'ignore'."

	// enable deferred context loading
	EnableDeferredLoadingFlagName    = "enableDeferredLoading"
	EnableDeferredLoadingDescription = "enable deferred loading of context variables"

	// generate validating admission policies
	GenerateValidatingAdmissionPolicyFlagName    = "generateValidatingAdmissionPolicy"
	GenerateValidatingAdmissionPolicyDescription = "Set the flag to 'true', to generate validating admission policies."
)

Variables

View Source
var (
	ProtectManagedResources           = newToggle(defaultProtectManagedResources, protectManagedResourcesEnvVar)
	ForceFailurePolicyIgnore          = newToggle(defaultForceFailurePolicyIgnore, forceFailurePolicyIgnoreEnvVar)
	EnableDeferredLoading             = newToggle(defaultEnableDeferredLoading, enableDeferredLoadingEnvVar)
	GenerateValidatingAdmissionPolicy = newToggle(defaultGenerateValidatingAdmissionPolicy, generateValidatingAdmissionPolicyEnvVar)
)

Functions

func NewContext added in v1.10.5

func NewContext(ctx context.Context, toggles Toggles) context.Context

Types

type Toggle added in v1.8.0

type Toggle interface {
	ToggleFlag
	// contains filtered or unexported methods
}

type ToggleFlag added in v1.10.5

type ToggleFlag interface {
	Parse(string) error
}

type Toggles added in v1.10.5

type Toggles interface {
	ProtectManagedResources() bool
	ForceFailurePolicyIgnore() bool
	EnableDeferredLoading() bool
	GenerateValidatingAdmissionPolicy() bool
}

func FromContext added in v1.10.5

func FromContext(ctx context.Context) Toggles

Jump to

Keyboard shortcuts

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