builder

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package builder provides a builder to build controllers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder builds a Controller.

func ControllerManagedBy

func ControllerManagedBy(m cmanager.Manager) *Builder

ControllerManagedBy returns a new controller builder that will be started by the provided Manager.

func (*Builder) Build

Build builds the Application Controller and returns the Controller it created.

func (*Builder) Complete

func (blder *Builder) Complete(r creconciler.Reconciler) error

Complete builds the Application Controller.

func (*Builder) For

func (blder *Builder) For(object client.Object, opts ...ForOption) *Builder

For defines the type of Object being *reconciled*, and configures the ControllerManagedBy to respond to create / delete / update events by *reconciling the object*.

func (*Builder) Named

func (blder *Builder) Named(name string) *Builder

Named sets the name of the controller to the given name. The name shows up in metrics, among other things, and thus should be a prometheus compatible name (underscores and alphanumeric characters only).

By default, controllers are named using the lowercase version of their kind.

func (*Builder) Watches

func (blder *Builder) Watches(src csource.Source, eventhandler handler.EventHandler, opts ...WatchesOption) *Builder

Watches defines the type of Object to watch, and configures the ControllerManagedBy to respond to create / delete / update events by *reconciling the object* with the given EventHandler.

func (*Builder) WithEventFilter

func (blder *Builder) WithEventFilter(p cpredicate.Predicate) *Builder

WithEventFilter sets the event filters, to filter which create/update/delete/generic events eventually trigger reconciliations. For example, filtering on whether the resource version has changed. Given predicate is added for all watched objects. Defaults to the empty list.

func (*Builder) WithOptions

func (blder *Builder) WithOptions(options ccontroller.Options) *Builder

WithOptions overrides the controller options use in doController. Defaults to empty.

type ForInput

type ForInput struct {
	// contains filtered or unexported fields
}

ForInput represents the information set by For method.

type ForOption

type ForOption interface {
	// ApplyToFor applies this configuration to the given for input.
	ApplyToFor(*ForInput)
}

ForOption is some configuration that modifies options for a For request.

type Predicates

type Predicates struct {
	// contains filtered or unexported fields
}

Predicates filters events before enqueuing the keys.

func WithPredicates

func WithPredicates(predicates ...cpredicate.Predicate) Predicates

WithPredicates sets the given predicates list.

func (Predicates) ApplyToFor

func (w Predicates) ApplyToFor(opts *ForInput)

ApplyToFor applies this configuration to the given ForInput options.

func (Predicates) ApplyToWatches

func (w Predicates) ApplyToWatches(opts *WatchesInput)

ApplyToWatches applies this configuration to the given WatchesInput options.

type WatchesInput

type WatchesInput struct {
	// contains filtered or unexported fields
}

WatchesInput represents the information set by Watches method.

type WatchesOption

type WatchesOption interface {
	// ApplyToWatches applies this configuration to the given watches options.
	ApplyToWatches(*WatchesInput)
}

WatchesOption is some configuration that modifies options for a watches request.

Jump to

Keyboard shortcuts

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