controller

package
v0.0.0-...-82afb99 Latest Latest
Warning

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

Go to latest
Published: May 16, 2018 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Overview

Package controller provides interfaces that are used to define and construct controller instances.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Constructor

type Constructor func(ctx *Context) Interface

Constructor is a function type that takes a controller context and returns a controller implementation. It is used to construct user defined controller instances.

type Context

type Context struct {
	// An instance of a Kubernetes API client
	Client clientset.Interface

	// SharedInformers allows controllers to register shared informer objects.
	SharedInformers informers.SharedInformers

	// Recorder is used for recording Kubernetes events
	Recorder record.EventRecorder

	// Logger is a logger that can be used by the controller to log info and error messages
	Logger *logging.Logger
}

Context defines a controller context. Each controller is given a context in it's constructor which provides it with various objects set up my the controller manager.

type Interface

type Interface interface {
	Run(ctx context.Context) error
}

Interface defines a Kubernetes controller. Each controller should define a Run method that accepts a context.Context object. The controller should terminate when the context's Done channel is closed.

Jump to

Keyboard shortcuts

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