api

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: MIT Imports: 11 Imported by: 22

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInstanceNotFound = errors.New("No such instance exists")
	ErrNotStarted       = errors.New("orchestration has not started")
	ErrNotCompleted     = errors.New("orchestration has not yet completed")
	ErrNoFailures       = errors.New("orchestration did not report failure details")

	EmptyInstanceID = InstanceID("")
)

Functions

func NewTaskHubGrpcClient added in v0.1.1

func NewTaskHubGrpcClient(cc grpc.ClientConnInterface) *grpcClient

NewTaskHubGrpcClient creates a client that can be used to manage orchestrations over a gRPC connection. The gRPC connection must be to a task hub worker that understands the Durable Task gRPC protocol.

Types

type FetchOrchestrationMetadataOptions added in v0.1.1

type FetchOrchestrationMetadataOptions func(*protos.GetInstanceRequest)

GetOrchestrationMetadataOptions is a set of options for fetching orchestration metadata.

func WithFetchPayloads added in v0.1.1

func WithFetchPayloads(fetchPayloads bool) FetchOrchestrationMetadataOptions

WithFetchPayloads configures whether to load orchestration inputs, outputs, and custom status values, which could be large.

type InstanceID

type InstanceID string

InstanceID is a unique identifier for an orchestration instance.

type NewOrchestrationOptions added in v0.1.1

type NewOrchestrationOptions func(*protos.CreateInstanceRequest)

NewOrchestrationOptions configures options for starting a new orchestration.

func WithInput added in v0.1.1

func WithInput(input any) NewOrchestrationOptions

WithInput configures an input for the orchestration. The specified input must be serializable.

func WithInstanceID added in v0.1.1

func WithInstanceID(id InstanceID) NewOrchestrationOptions

WithInstanceID configures an explicit orchestration instance ID. If not specified, a random UUID value will be used for the orchestration instance ID.

func WithStartTime added in v0.1.1

func WithStartTime(startTime time.Time) NewOrchestrationOptions

WithStartTime configures a start time at which the orchestration should start running. Note that the actual start time could be later than the specified start time if the task hub is under load or if the app is not running at the specified start time.

type OrchestrationMetadata

type OrchestrationMetadata struct {
	InstanceID             InstanceID
	Name                   string
	RuntimeStatus          protos.OrchestrationStatus
	CreatedAt              time.Time
	LastUpdatedAt          time.Time
	SerializedInput        string
	SerializedOutput       string
	SerializedCustomStatus string
	FailureDetails         *protos.TaskFailureDetails
}

func NewOrchestrationMetadata

func NewOrchestrationMetadata(
	iid InstanceID,
	name string,
	status protos.OrchestrationStatus,
	createdAt time.Time,
	lastUpdatedAt time.Time,
	serializedInput string,
	serializedOutput string,
	serializedCustomStatus string,
	failureDetails *protos.TaskFailureDetails) *OrchestrationMetadata

func (*OrchestrationMetadata) IsComplete

func (o *OrchestrationMetadata) IsComplete() bool

func (*OrchestrationMetadata) IsRunning

func (o *OrchestrationMetadata) IsRunning() bool

func (*OrchestrationMetadata) MarshalJSON added in v0.1.1

func (m *OrchestrationMetadata) MarshalJSON() ([]byte, error)

func (*OrchestrationMetadata) UnmarshalJSON added in v0.1.1

func (m *OrchestrationMetadata) UnmarshalJSON(data []byte) (err error)

Jump to

Keyboard shortcuts

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