Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ack ¶
type Ack[I ID] struct { // contains filtered or unexported fields }
Ack acknowledges a reconciliation request
func (*Ack[I]) Do ¶
func (c *Ack[I]) Do(controller *Controller[I])
Do executes the controller directive
type Backoff ¶
Backoff is a function for computing the backoff duration following a failed request
func ConstantBackoff ¶
ConstantBackoff computes a constant backoff delay
type Controller ¶
Controller manages a set of control loops for reconciling objects. The type parameter is the type of object identifier reconciled by this controller. To reconcile an object, enqueue the object ID by calling the Reconcile method. Once called, the controller will call the configured Reconciler to reconcile the request until complete.
func NewController ¶
func NewController[I ID](reconciler Reconciler[I], opts ...Option) *Controller[I]
NewController creates a new controller
func (*Controller[I]) Reconcile ¶
func (c *Controller[I]) Reconcile(id I) error
Reconcile reconciles the given object ID
type Directive ¶
type Directive[I ID] interface { Do(controller *Controller[I]) }
Directive is a controller directive indicating how to proceed after reconciliation
type Fail ¶
Fail fails a reconciliation request
func (*Fail[I]) Do ¶
func (f *Fail[I]) Do(controller *Controller[I])
Do executes the controller directive
type Option ¶
type Option func(*Options)
Option is a Controller option
func WithBufferSize ¶
WithBufferSize sets the buffer size for reconciliation queues
func WithParallelism ¶
WithParallelism sets the number of parallel goroutines to use for reconciliation
func WithTimeout ¶
WithTimeout sets the timeout for each reconciliation cycle
type Reconciler ¶
Reconciler reconciles an object
type Request ¶
type Request[I ID] struct { ID I // contains filtered or unexported fields }
Request is a reconciler request
func (Request[I]) Ack ¶
Ack acknowledges the request was reconciled successfully, removing it from the reconciliation queue.
func (Request[I]) Fail ¶
Fail fails reconciliation of the request, logging the given error and removing it from the reconciliation queue.
type Requeue ¶
type Requeue[I ID] struct { // contains filtered or unexported fields }
Requeue requeues a reconciliation request
func (*Requeue[I]) Do ¶
func (r *Requeue[I]) Do(controller *Controller[I])
Do executes the controller directive
type Retry ¶
Retry retries a reconciliation request
func (*Retry[I]) After ¶
func (r *Retry[I]) After(delay time.Duration) *RetryAfter[I]
After retries the request after the given delay
func (*Retry[I]) Do ¶
func (r *Retry[I]) Do(controller *Controller[I])
Do executes the controller directive
type RetryAfter ¶
RetryAfter retries a reconciliation request after a delay
func (*RetryAfter[I]) Do ¶
func (r *RetryAfter[I]) Do(controller *Controller[I])
Do executes the controller directive