Documentation ¶
Index ¶
- Variables
- type CreateOrchestrationAction
- type FetchOrchestrationMetadataOptions
- type InstanceID
- type NewOrchestrationOptions
- func WithInput(input any) NewOrchestrationOptions
- func WithInstanceID(id InstanceID) NewOrchestrationOptions
- func WithOrchestrationIdReusePolicy(policy *protos.OrchestrationIdReusePolicy) NewOrchestrationOptions
- func WithRawInput(rawInput string) NewOrchestrationOptions
- func WithStartTime(startTime time.Time) NewOrchestrationOptions
- type OrchestrationIdReusePolicy
- type OrchestrationMetadata
- type OrchestrationStatus
- type PurgeOptions
- type RaiseEventOptions
- type TerminateOptions
Constants ¶
This section is empty.
Variables ¶
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") ErrDuplicateInstance = errors.New("orchestration instance already exists") ErrIgnoreInstance = errors.New("ignore creating orchestration instance") EmptyInstanceID = InstanceID("") )
Functions ¶
This section is empty.
Types ¶
type CreateOrchestrationAction ¶ added in v0.3.2
type CreateOrchestrationAction = protos.CreateOrchestrationAction
const ( REUSE_ID_ACTION_ERROR CreateOrchestrationAction = protos.CreateOrchestrationAction_ERROR REUSE_ID_ACTION_IGNORE CreateOrchestrationAction = protos.CreateOrchestrationAction_IGNORE REUSE_ID_ACTION_TERMINATE CreateOrchestrationAction = protos.CreateOrchestrationAction_TERMINATE )
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) error
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 WithOrchestrationIdReusePolicy ¶ added in v0.3.2
func WithOrchestrationIdReusePolicy(policy *protos.OrchestrationIdReusePolicy) NewOrchestrationOptions
WithOrchestrationIdReusePolicy configures Orchestration ID reuse policy.
func WithRawInput ¶ added in v0.2.1
func WithRawInput(rawInput string) NewOrchestrationOptions
WithRawInput configures an input for the orchestration. The specified input must be a string.
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 OrchestrationIdReusePolicy ¶ added in v0.3.2
type OrchestrationIdReusePolicy = protos.OrchestrationIdReusePolicy
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)
type OrchestrationStatus ¶ added in v0.3.2
type OrchestrationStatus = protos.OrchestrationStatus
const ( RUNTIME_STATUS_RUNNING OrchestrationStatus = protos.OrchestrationStatus_ORCHESTRATION_STATUS_RUNNING RUNTIME_STATUS_COMPLETED OrchestrationStatus = protos.OrchestrationStatus_ORCHESTRATION_STATUS_COMPLETED RUNTIME_STATUS_CONTINUED_AS_NEW OrchestrationStatus = protos.OrchestrationStatus_ORCHESTRATION_STATUS_CONTINUED_AS_NEW RUNTIME_STATUS_FAILED OrchestrationStatus = protos.OrchestrationStatus_ORCHESTRATION_STATUS_FAILED RUNTIME_STATUS_CANCELED OrchestrationStatus = protos.OrchestrationStatus_ORCHESTRATION_STATUS_CANCELED RUNTIME_STATUS_TERMINATED OrchestrationStatus = protos.OrchestrationStatus_ORCHESTRATION_STATUS_TERMINATED RUNTIME_STATUS_PENDING OrchestrationStatus = protos.OrchestrationStatus_ORCHESTRATION_STATUS_PENDING RUNTIME_STATUS_SUSPENDED OrchestrationStatus = protos.OrchestrationStatus_ORCHESTRATION_STATUS_SUSPENDED )
type PurgeOptions ¶ added in v0.5.0
type PurgeOptions func(*protos.PurgeInstancesRequest) error
PurgeOptions is a set of options for purging an orchestration.
func WithRecursivePurge ¶ added in v0.5.0
func WithRecursivePurge(recursive bool) PurgeOptions
WithRecursivePurge configures whether to purge all sub-orchestrations created by the target orchestration.
type RaiseEventOptions ¶ added in v0.2.1
type RaiseEventOptions func(*protos.RaiseEventRequest) error
RaiseEventOptions is a set of options for raising an orchestration event.
func WithEventPayload ¶ added in v0.3.0
func WithEventPayload(data any) RaiseEventOptions
WithEventPayload configures an event payload. The specified payload must be serializable.
func WithRawEventData ¶ added in v0.2.1
func WithRawEventData(data string) RaiseEventOptions
WithRawEventData configures an event payload that is a raw, unprocessed string (e.g. JSON data).
type TerminateOptions ¶ added in v0.3.0
type TerminateOptions func(*protos.TerminateRequest) error
TerminateOptions is a set of options for terminating an orchestration.
func WithOutput ¶ added in v0.3.0
func WithOutput(data any) TerminateOptions
WithOutput configures an output for the terminated orchestration. The specified output must be serializable.
func WithRawOutput ¶ added in v0.3.0
func WithRawOutput(data string) TerminateOptions
WithRawOutput configures a raw, unprocessed output (i.e. pre-serialized) for the terminated orchestration.
func WithRecursiveTerminate ¶ added in v0.5.0
func WithRecursiveTerminate(recursive bool) TerminateOptions
WithRecursiveTerminate configures whether to terminate all sub-orchestrations created by the target orchestration.