control

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// EnvVarEnableTestAPIs controls if test APIS are enabled (currently e2e test controller).
	EnvVarEnableTestAPIs = "ENABLE_TEST_APIS"
)

Variables

This section is empty.

Functions

func Register

func Register(name, description string, c Controller) error

Register registers a new controller.

Types

type Control

type Control interface {
	// StartStopControllers starts/stops all controllers according to configuration.
	StartStopControllers(*cfgapi.Config) error
	// PreCreateHooks runs the pre-create hooks of all registered controllers.
	RunPreCreateHooks(cache.Container) error
	// RunPreStartHooks runs the pre-start hooks of all registered controllers.
	RunPreStartHooks(cache.Container) error
	// RunPostStartHooks runs the post-start hooks of all registered controllers.
	RunPostStartHooks(cache.Container) error
	// RunPostUpdateHooks runs the post-update hooks of all registered controllers.
	RunPostUpdateHooks(cache.Container) error
	// RunPostStopHooks runs the post-stop hooks of all registered controllers.
	RunPostStopHooks(cache.Container) error
}

Control is the interface for triggering controller-/domain-specific post-decision actions.

func NewControl

func NewControl(cc cache.Cache) (Control, error)

NewControl creates a new controller-agnostic instance.

type Controller

type Controller interface {
	// Start prepares the controller for resource control/decision enforcement.
	Start(cache.Cache, *cfgapi.Config) (bool, error)
	// Stop shuts down the controller.
	Stop()
	// PreCreateHook is the controller's pre-create hook.
	PreCreateHook(cache.Container) error
	// PreStartHook is the controller's pre-start hook.
	PreStartHook(cache.Container) error
	// PostStartHook is the controller's post-start hook.
	PostStartHook(cache.Container) error
	// PostUpdateHook is the controller's post-update hook.
	PostUpdateHook(cache.Container) error
	// PostStopHook is the controller's post-stop hook.
	PostStopHook(cache.Container) error
}

Controller is the interface all resource controllers must implement.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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