controller

package
v0.35.0-rc1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCreateOrUpdateResource

func NewCreateOrUpdateResource[P interface {
	*T
	rpv1.RadiusResourceModel
}, T any](opts ctrl.Options, processor processors.ResourceProcessor[P, T], eng engine.Engine, client processors.ResourceClient, configurationLoader configloader.ConfigurationLoader) (ctrl.Controller, error)

NewCreateOrUpdateResource creates a new controller for creating or updating a resource with the given processor, engine, client, configurationLoader and options. The processor function will be called to process updates to the resource.

func NewDeleteResource

func NewDeleteResource[P interface {
	*T
	rpv1.RadiusResourceModel
}, T any](opts ctrl.Options, processor processors.ResourceProcessor[P, T], eng engine.Engine, configurationLoader configloader.ConfigurationLoader) (ctrl.Controller, error)

NewDeleteResource creates a new DeleteResource controller which is used to delete resources asynchronously.

Types

type CreateOrUpdateResource

type CreateOrUpdateResource[P interface {
	*T
	rpv1.RadiusResourceModel
}, T any] struct {
	ctrl.BaseController
	// contains filtered or unexported fields
}

CreateOrUpdateResource is the async operation controller to create or update portable resources.

func (*CreateOrUpdateResource[P, T]) Run

func (c *CreateOrUpdateResource[P, T]) Run(ctx context.Context, req *ctrl.Request) (ctrl.Result, error)

Run retrieves an existing resource, executes a recipe if needed, loads runtime configuration, processes the resource, cleans up any obsolete output resources, and saves the updated resource.

type DeleteResource

type DeleteResource[P interface {
	*T
	rpv1.RadiusResourceModel
}, T any] struct {
	ctrl.BaseController
	// contains filtered or unexported fields
}

DeleteResource is the async operation controller to delete a portable resource.

func (*DeleteResource[P, T]) Run

func (c *DeleteResource[P, T]) Run(ctx context.Context, request *ctrl.Request) (ctrl.Result, error)

Run retrieves a resource from storage, parses the resource ID, gets the data model, deletes the output resources, and deletes the resource from storage. It returns an error if any of these steps fail.

Jump to

Keyboard shortcuts

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