Versions in this module Expand all Collapse all v0 v0.1.4 Apr 8, 2024 Changes in this version + func IsMarkedForDeletion(obj client.Object) bool + type ObjWithConditionsAndState interface + SetState func(v string) + State func() string + type ObjectList interface + GetItemCount func() int + GetItems func() []client.Object type StateCluster + ApiReader func() client.Reader v0.0.2 Mar 4, 2024 v0.0.1 Mar 1, 2024 Changes in this version + var Break error + var StopAndForget error + var StopWithRequeue error + func Handle(err error, _ context.Context) (ctrl.Result, error) + func IsBreak(err error) bool + func IsFlowControl(err error) bool + func IsStopAndForget(err error) bool + func IsStopWithRequeue(err error) bool + func IsStopWithRequeueDelay(err error) bool + func IsTerminal(err error) bool + func LoadObj(ctx context.Context, state State) (error, context.Context) + func LogErrorAndReturn(err error, msg string, result error, ctx context.Context) (error, context.Context) + func LoggerFromCtx(ctx context.Context) logr.Logger + func LoggerIntoCtx(ctx context.Context, logger logr.Logger) context.Context + func MarkedForDeletionPredicate(ctx context.Context, state State) bool + func StopAndForgetAction(_ context.Context, _ State) (error, context.Context) + func StopWithRequeueAction(_ context.Context, _ State) (error, context.Context) + func StopWithRequeueDelay(d time.Duration) error + type Action func(ctx context.Context, state State) (error, context.Context) + func BreakIf(predicate Predicate) Action + func BuildBranchingAction(name string, predicate Predicate, trueAction Action, falseAction Action) Action + func BuildSwitchAction(name string, defaultAction Action, cases ...Case) Action + func ComposeActions(name string, actions ...Action) Action + func StopWithRequeueDelayAction(d time.Duration) Action + type Case interface + Action func(ctx context.Context, state State) (error, context.Context) + Predicate func(ctx context.Context, state State) bool + func NewCase(p Predicate, a Action) Case + type CaseStruct struct + A Action + P Predicate + func (cs *CaseStruct) Action(ctx context.Context, state State) (error, context.Context) + func (cs *CaseStruct) Predicate(ctx context.Context, state State) bool + type FlowControlError interface + ShouldReturnError func() bool + type ObjWithConditions interface + Conditions func() *[]metav1.Condition + GetObjectMeta func() *metav1.ObjectMeta + type Predicate func(ctx context.Context, state State) bool + func All(predicates ...Predicate) Predicate + func Any(predicates ...Predicate) Predicate + func Not(p Predicate) Predicate + type State interface + Cluster func() StateCluster + EventRecorder func() record.EventRecorder + K8sClient func() client.Client + LoadObj func(ctx context.Context, opts ...client.GetOption) error + Name func() types.NamespacedName + Obj func() client.Object + Scheme func() *runtime.Scheme + SetObj func(client.Object) + UpdateObj func(ctx context.Context, opts ...client.UpdateOption) error + UpdateObjStatus func(ctx context.Context, opts ...client.SubResourceUpdateOption) error + type StateCluster interface + EventRecorder func() record.EventRecorder + K8sClient func() client.Client + Scheme func() *runtime.Scheme + func NewStateCluster(client client.Client, eventRecorder record.EventRecorder, ...) StateCluster + func NewStateClusterFromCluster(cluster cluster.Cluster) StateCluster + type StateFactory interface + NewState func(name types.NamespacedName, obj client.Object) State + func NewStateFactory(cluster StateCluster) StateFactory + type UpdateStatusBuilder struct + func UpdateStatus(obj ObjWithConditions) *UpdateStatusBuilder + func (b *UpdateStatusBuilder) ErrorLogMessage(msg string) *UpdateStatusBuilder + func (b *UpdateStatusBuilder) FailedError(err error) *UpdateStatusBuilder + func (b *UpdateStatusBuilder) KeepConditions(conditionTypes ...string) *UpdateStatusBuilder + func (b *UpdateStatusBuilder) OnUpdateError(f func(ctx context.Context, err error) (error, context.Context)) *UpdateStatusBuilder + func (b *UpdateStatusBuilder) OnUpdateSuccess(f func(ctx context.Context) (error, context.Context)) *UpdateStatusBuilder + func (b *UpdateStatusBuilder) RemoveConditionIfReasonMatched(conditionType, conditionReason string) *UpdateStatusBuilder + func (b *UpdateStatusBuilder) RemoveConditions(conditionTypes ...string) *UpdateStatusBuilder + func (b *UpdateStatusBuilder) Run(ctx context.Context, state State) (error, context.Context) + func (b *UpdateStatusBuilder) SetCondition(cond metav1.Condition) *UpdateStatusBuilder + func (b *UpdateStatusBuilder) SetExclusiveConditions(conditions ...metav1.Condition) *UpdateStatusBuilder + func (b *UpdateStatusBuilder) SuccessError(err error) *UpdateStatusBuilder + func (b *UpdateStatusBuilder) SuccessErrorNil() *UpdateStatusBuilder + func (b *UpdateStatusBuilder) SuccessLogMsg(msg string) *UpdateStatusBuilder + func (b *UpdateStatusBuilder) UpdateErrorWrapper(f func(err error) error) *UpdateStatusBuilder