controller

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2022 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Overview

Package controller contains implementation and defition to create kubernetes controllers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.3.0

type Config struct {
	// name of the controller.
	Name string
	// ConcurrentWorkers is the number of concurrent workers the controller will have running processing events.
	ConcurrentWorkers int
	// ResyncInterval is the interval the controller will process all the selected resources.
	ResyncInterval time.Duration
	// ProcessingJobRetries is the number of times the job will try to reprocess the event before returning a real error.
	ProcessingJobRetries int
}

Config is the controller configuration.

type Controller

type Controller interface {
	// Run runs the controller, it receives a channel that when receiving a signal it will stop the controller,
	// Run will block until it's stopped.
	Run(stopper <-chan struct{}) error
}

Controller is the object that will implement the different kinds of controllers that will be running on the application.

func New added in v0.3.0

func New(cfg *Config, handler handler.Handler, retriever retrieve.Retriever, leaderElector leaderelection.Runner, tracer opentracing.Tracer, metricRecorder metrics.Recorder, logger log.Logger) Controller

New creates a new controller that can be configured using the cfg parameter.

func NewConcurrent added in v0.2.0

func NewConcurrent(concurrentWorkers int, resync time.Duration, handler handler.Handler, retriever retrieve.Retriever, metricRecorder metrics.Recorder, logger log.Logger) (Controller, error)

NewConcurrent creates a new controller that will process the received events concurrently. This constructor is just a wrapper to help bootstrapping default concurrent controller.

func NewSequential

func NewSequential(resync time.Duration, handler handler.Handler, retriever retrieve.Retriever, metricRecorder metrics.Recorder, logger log.Logger) Controller

NewSequential creates a new controller that will process the received events sequentially. This constructor is just a wrapper to help bootstrapping default sequential controller.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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