controller

package
v0.0.0-...-0d9f232 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext

func NewContext() context.Context

NewContext

func NewCreateOptions

func NewCreateOptions() meta.CreateOptions

NewCreateOptions returns filled metav1.CreateOptions

func NewDeleteOptions

func NewDeleteOptions() meta.DeleteOptions

NewDeleteOptions returns filled *metav1.DeleteOptions

func NewGetOptions

func NewGetOptions() meta.GetOptions

NewGetOptions returns filled metav1.GetOptions

func NewListOptions

func NewListOptions(labelsMaps ...map[string]string) meta.ListOptions

NewListOptions returns filled meta.ListOptions

func NewPatchOptions

func NewPatchOptions() meta.PatchOptions

NewPatchOptions returns filled metav1.PatchOptions

func NewUpdateOptions

func NewUpdateOptions() meta.UpdateOptions

NewUpdateOptions returns filled metav1.UpdateOptions

func Poll

func Poll(
	ctx context.Context,
	namespace, name string,
	opts *PollerOptions,
	main *PollerFunctions,
	background *PollerBackgroundFunctions,
) error

Types

type PollerBackgroundFunctions

type PollerBackgroundFunctions struct {
	F func(context.Context)
}

type PollerFunctions

type PollerFunctions struct {
	Get            func(context.Context) (any, error)
	IsDone         func(context.Context, any) bool
	ShouldContinue func(context.Context, any, error) bool
}

func (*PollerFunctions) CallGet

func (p *PollerFunctions) CallGet(c context.Context) (any, error)

func (*PollerFunctions) CallIsDone

func (p *PollerFunctions) CallIsDone(c context.Context, a any) bool

func (*PollerFunctions) CallShouldContinue

func (p *PollerFunctions) CallShouldContinue(c context.Context, a any, e error) bool

type PollerOptions

type PollerOptions struct {
	StartBotheringAfterTimeout time.Duration
	GetErrorTimeout            time.Duration
	Timeout                    time.Duration
	MainInterval               time.Duration
	BackgroundInterval         time.Duration
}

PollerOptions specifies polling options

func NewPollerOptions

func NewPollerOptions() *PollerOptions

NewPollerOptions creates new poll options

func (*PollerOptions) Ensure

func (o *PollerOptions) Ensure() *PollerOptions

Ensure ensures poll options do exist

func (*PollerOptions) FromConfig

func (o *PollerOptions) FromConfig(config *api.OperatorConfig) *PollerOptions

FromConfig makes poll options from config

func (*PollerOptions) SetGetErrorTimeout

func (o *PollerOptions) SetGetErrorTimeout(timeout time.Duration) *PollerOptions

SetCreateTimeout sets create timeout

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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