control

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

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