action

package
v0.0.0-...-8262c23 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	Run(ctx Context) (Result, error)
}

type ActionFn

type ActionFn func(Context) (Result, error)

func (ActionFn) Run

func (fn ActionFn) Run(ctx Context) (Result, error)

type AroundFunc

type AroundFunc func(ctx Context, innerAction Action) (Result, error)

type CompositeAction

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

func Composite

func Composite(actions ...Action) *CompositeAction

func (*CompositeAction) AllowErrors

func (a *CompositeAction) AllowErrors() *CompositeAction

func (*CompositeAction) Run

func (a *CompositeAction) Run(ctx Context) (Result, error)

type Context

type Context interface {
	context.Context
	Logger() logr.Logger
	Resource() runtimeclient.Object
	WithLoggerValues(values ...interface{}) Context
	WithResource(obj runtimeclient.Object) Context
}

Context used to pass information between actions

func NewBackgroundContext

func NewBackgroundContext() Context

func NewContext

func NewContext(ctx context.Context) Context

type Result

type Result struct {
	Requeue      bool
	RequeueAfter time.Duration
	Halt         bool
}

func (Result) Merge

func (self Result) Merge(others ...Result) Result

type WrapAction

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

func Wrap

func Wrap(action Action, aroundFn AroundFunc) *WrapAction

func (*WrapAction) Run

func (a *WrapAction) Run(ctx Context) (Result, error)

Jump to

Keyboard shortcuts

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