Documentation ¶
Overview ¶
Package controller contains implementation and defition to create kubernetes controllers.
Index ¶
- type Config
- type Controller
- func New(cfg *Config, handler handler.Handler, retriever retrieve.Retriever, ...) Controller
- func NewConcurrent(concurrentWorkers int, resync time.Duration, handler handler.Handler, ...) (Controller, error)
- func NewSequential(resync time.Duration, handler handler.Handler, retriever retrieve.Retriever, ...) Controller
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
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 ¶
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 ¶
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.