durable

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 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) DeploymentLogs added in v0.32.0

func (s Service) DeploymentLogs(
	ctx context.Context, functionID, deploymentID uuid.UUID, limit int, cursor string,
) (*apiclient.LogSearchResponse, error)

DeploymentLogs returns one build log search page for a durable function's deployment.

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) RuntimeLogs added in v0.32.0

func (s Service) RuntimeLogs(
	ctx context.Context, functionID uuid.UUID, limit int, cursor string,
) (*apiclient.LogSearchResponse, error)

RuntimeLogs returns one runtime log search page for a durable function.

The log routes are project-scoped and take a function id whatever collection it came from, so these four read a durable function's logs through the same endpoints a standard function's do.

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.

func (Service) StreamDeploymentLogs added in v0.32.0

func (s Service) StreamDeploymentLogs(
	ctx context.Context, functionID, deploymentID uuid.UUID, limit int,
) (*api.ProjectLogStream, error)

StreamDeploymentLogs opens a build log stream for a durable function's deployment.

func (Service) StreamRuntimeLogs added in v0.32.0

func (s Service) StreamRuntimeLogs(
	ctx context.Context, functionID uuid.UUID, limit int, lastEventID string,
) (*api.ProjectLogStream, error)

StreamRuntimeLogs opens a runtime log stream for a durable function, resuming after lastEventID when it is set.

Jump to

Keyboard shortcuts

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