controller

package
v0.0.0-...-bb7034b Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	CRD    *crd.Handle
	Hooks  Hooks
	Client rest.Interface
	Scheme *runtime.Scheme
	// contains filtered or unexported fields
}

Controller watches a resource and delegates create/update/delete events to a set of supplied callback functions.

func New

func New(handle *crd.Handle, hooks Hooks, client rest.Interface) *Controller

New returns a new Controller.

func (*Controller) Run

func (c *Controller) Run(ctx context.Context, namespace string) error

Run starts a resource controller

type Hooks

type Hooks interface {
	Add(obj interface{})
	Update(oldObj, newObj interface{})
	Delete(obj interface{})
}

Hooks is the callback interface that defines controller behavior.

Jump to

Keyboard shortcuts

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