durable

package
v0.28.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package durable performs authenticated Volcano durable function workflows.

Durable functions are their own collection: they are started rather than invoked, an execution outlives the request that began it, and the API resolves a function by name or id server-side. That last part is why this package is thinner than internal/function, which pages a list to turn a name into an id.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service performs durable function workflows against the current project.

func NewService

func NewService(deps cliruntime.Deps) Service

NewService returns a durable function service.

func (Service) CreateScheduler

func (s Service) CreateScheduler(
	ctx context.Context,
	identifier string,
	input api.FunctionSchedulerInput,
) (*apiclient.FunctionScheduler, error)

CreateScheduler adds a scheduler to one durable function. Each tick starts an execution rather than invoking the function.

func (Service) Delete

func (s Service) Delete(ctx context.Context, identifier string) error

Delete starts deleting one durable function by name or id.

func (Service) DeleteScheduler

func (s Service) DeleteScheduler(ctx context.Context, identifier string, schedulerID uuid.UUID) error

DeleteScheduler removes a scheduler and its run history. Executions it already started keep running.

func (Service) Deploy

func (s Service) Deploy(ctx context.Context, pkg clifunction.Package, isPublic *bool) (*apiclient.DurableFunction, error)

Deploy uploads one packaged source archive as a durable function. It creates the function on the first call for a name and redeploys it after that.

isPublic is left nil to keep the deployed function's current visibility, which is what the collection does with an absent field. A new function starts private.

func (Service) DisableScheduler

func (s Service) DisableScheduler(
	ctx context.Context, identifier string, schedulerID uuid.UUID,
) (*apiclient.FunctionScheduler, error)

DisableScheduler stops a scheduler's ticks without deleting it. Executions already started keep running.

func (Service) EnableScheduler

func (s Service) EnableScheduler(
	ctx context.Context, identifier string, schedulerID uuid.UUID,
) (*apiclient.FunctionScheduler, error)

EnableScheduler resumes a scheduler's ticks.

func (Service) Get

func (s Service) Get(ctx context.Context, identifier string) (*apiclient.DurableFunction, error)

Get returns one durable function by name or id.

func (Service) GetExecution

func (s Service) GetExecution(
	ctx context.Context,
	identifier string,
	executionID uuid.UUID,
) (*apiclient.DurableExecution, error)

GetExecution returns one execution, including its result once it has finished.

func (Service) ListExecutions

func (s Service) ListExecutions(
	ctx context.Context,
	identifier, status string,
	page, limit int,
) (*apiclient.PaginatedDurableExecutions, error)

ListExecutions returns one execution page for a durable function. An empty status lists every execution.

func (Service) ListPage

func (s Service) ListPage(ctx context.Context, page, limit int) (*apiclient.PaginatedDurableFunctions, error)

ListPage returns one durable function page in the current project.

func (Service) ListSchedulers

func (s Service) ListSchedulers(
	ctx context.Context,
	identifier string,
) (*apiclient.FunctionSchedulerListResponse, error)

ListSchedulers returns the schedulers of one durable function.

func (Service) StartExecution

func (s Service) StartExecution(
	ctx context.Context,
	identifier string,
	input api.DurableExecutionStartInput,
) (*apiclient.DurableExecution, error)

StartExecution starts one execution and returns its handle. Starting is asynchronous by construction, so this never carries a result.

func (Service) StopExecution

func (s Service) StopExecution(
	ctx context.Context,
	identifier string,
	executionID uuid.UUID,
) (*apiclient.DurableExecution, error)

StopExecution stops one execution. Steps already completed are not undone.

Jump to

Keyboard shortcuts

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