controllerstate

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package controllerstate provides adapter which filters access to the resource state by controller inputs/outputs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StateAdapter

type StateAdapter struct {
	State state.State
	Cache *cache.ResourceCache
	Name  string

	UpdateLimiter *rate.Limiter
	Logger        *zap.Logger

	Inputs  []controller.Input
	Outputs []controller.Output

	WarnOnUncachedReads bool
}

StateAdapter implements filtered access to the resource state by controller inputs/outputs.

If the read cache is enabled for a resource type, controller.Reader interface will be redirected to the cache.

func (*StateAdapter) AddFinalizer

func (adapter *StateAdapter) AddFinalizer(ctx context.Context, resourcePointer resource.Pointer, fins ...resource.Finalizer) error

AddFinalizer implements controller.Runtime interface.

func (*StateAdapter) ContextWithTeardown

func (adapter *StateAdapter) ContextWithTeardown(ctx context.Context, resourcePointer resource.Pointer) (context.Context, error)

ContextWithTeardown implements controller.Runtime interface.

func (*StateAdapter) Create

func (adapter *StateAdapter) Create(ctx context.Context, r resource.Resource) error

Create implements controller.Runtime interface.

func (*StateAdapter) Destroy

func (adapter *StateAdapter) Destroy(ctx context.Context, resourcePointer resource.Pointer, opOpts ...controller.Option) error

Destroy implements controller.Runtime interface.

func (*StateAdapter) Get

func (adapter *StateAdapter) Get(ctx context.Context, resourcePointer resource.Pointer, opts ...state.GetOption) (resource.Resource, error)

Get implements controller.Runtime interface.

func (*StateAdapter) GetUncached added in v0.4.6

func (adapter *StateAdapter) GetUncached(ctx context.Context, resourcePointer resource.Pointer, opts ...state.GetOption) (resource.Resource, error)

GetUncached implements controller.Runtime interface.

func (*StateAdapter) List

func (adapter *StateAdapter) List(ctx context.Context, resourceKind resource.Kind, opts ...state.ListOption) (resource.List, error)

List implements controller.Runtime interface.

func (*StateAdapter) ListUncached added in v0.4.6

func (adapter *StateAdapter) ListUncached(ctx context.Context, resourceKind resource.Kind, opts ...state.ListOption) (resource.List, error)

ListUncached implements controller.Runtime interface.

func (*StateAdapter) Modify

func (adapter *StateAdapter) Modify(ctx context.Context, emptyResource resource.Resource, updateFunc func(resource.Resource) error) error

Modify implements controller.Runtime interface.

func (*StateAdapter) ModifyWithResult

func (adapter *StateAdapter) ModifyWithResult(ctx context.Context, emptyResource resource.Resource, updateFunc func(resource.Resource) error) (resource.Resource, error)

ModifyWithResult implements controller.Runtime interface.

func (*StateAdapter) RemoveFinalizer

func (adapter *StateAdapter) RemoveFinalizer(ctx context.Context, resourcePointer resource.Pointer, fins ...resource.Finalizer) error

RemoveFinalizer implements controller.Runtime interface.

func (*StateAdapter) Teardown

func (adapter *StateAdapter) Teardown(ctx context.Context, resourcePointer resource.Pointer, opOpts ...controller.Option) (bool, error)

Teardown implements controller.Runtime interface.

func (*StateAdapter) Update

func (adapter *StateAdapter) Update(ctx context.Context, newResource resource.Resource) error

Update implements controller.Runtime interface.

Jump to

Keyboard shortcuts

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