helpers

package
v1.0.0-beta.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const RejectAllWorkItemFilterName = "\x00__durabletask_reject_all__"

RejectAllWorkItemFilterName is the sentinel orchestration/activity name a worker advertises when its registry matches nothing, so the scheduler sends it no work instead of falling back to unfiltered delivery.

Variables

This section is empty.

Functions

func CloneTraceContext

func CloneTraceContext(value *protos.TraceContext) *protos.TraceContext

CloneTraceContext returns an independent copy of the active W3C trace fields.

func CompareTaskVersions

func CompareTaskVersions(left, right string) int

CompareTaskVersions uses numeric comparison for two to four nonnegative integer components, otherwise case-insensitive lexical comparison. An empty version sorts before every nonempty version.

func ContextWithTraceContext

func ContextWithTraceContext(ctx context.Context, value *protos.TraceContext) context.Context

ContextWithTraceContext restores a wire parent without starting or recording a span.

func EntitySignalProperty

func EntitySignalProperty(requestID string) string

func FromRuntimeStatusString added in v0.1.1

func FromRuntimeStatusString(status string) protos.OrchestrationStatus

func GetTaskFunctionName added in v0.1.1

func GetTaskFunctionName(f any) string

func IsEntityInstanceID

func IsEntityInstanceID(instanceID string) bool

IsEntityInstanceID reports whether the instance ID uses the reserved entity format.

func NewCompleteOrchestrationAction

func NewCompleteOrchestrationAction(
	taskID int32,
	status protos.OrchestrationStatus,
	rawResult *wrapperspb.StringValue,
	carryoverEvents []*protos.HistoryEvent,
	failureDetails *protos.TaskFailureDetails,
) *protos.OrchestratorAction

func NewCreateSubOrchestrationAction

func NewCreateSubOrchestrationAction(
	taskID int32,
	name string,
	iid string,
	input *wrapperspb.StringValue,
	version ...*wrapperspb.StringValue,
) *protos.OrchestratorAction

func NewCreateTimerAction

func NewCreateTimerAction(taskID int32, fireAt time.Time) *protos.OrchestratorAction

func NewEntityLockRequestedAction

func NewEntityLockRequestedAction(
	id int32,
	criticalSectionID string,
	parentInstanceID string,
	lockSet []string,
) *protos.OrchestratorAction

func NewEntityOperationCalledAction

func NewEntityOperationCalledAction(
	id int32,
	requestID string,
	entityID string,
	parentInstanceID string,
	parentExecutionID string,
	operation string,
	input *wrapperspb.StringValue,
) *protos.OrchestratorAction

func NewEntityOperationSignaledAction

func NewEntityOperationSignaledAction(
	id int32,
	requestID string,
	entityID string,
	operation string,
	input *wrapperspb.StringValue,
	scheduledTime *timestamppb.Timestamp,
) *protos.OrchestratorAction

func NewEntityUnlockSentAction

func NewEntityUnlockSentAction(
	id int32,
	criticalSectionID string,
	parentInstanceID string,
	entityID string,
) *protos.OrchestratorAction

func NewEventRaisedEvent

func NewEventRaisedEvent(name string, rawInput *wrapperspb.StringValue) *protos.HistoryEvent

func NewExecutionStartedEvent

func NewExecutionStartedEvent(
	name string,
	instanceId string,
	input *wrapperspb.StringValue,
	parent *protos.ParentInstanceInfo,
	parentTraceContext *protos.TraceContext,
	scheduledStartTimeStamp *timestamppb.Timestamp,
	version ...*wrapperspb.StringValue,
) *protos.HistoryEvent

func NewExecutionTerminatedEvent

func NewExecutionTerminatedEvent(rawReason *wrapperspb.StringValue, recurse bool) *protos.HistoryEvent

func NewOrchestratorStartedEvent

func NewOrchestratorStartedEvent() *protos.HistoryEvent

func NewParentInfo

func NewParentInfo(taskID int32, name string, iid string) *protos.ParentInstanceInfo

func NewResumeOrchestrationEvent added in v0.1.4

func NewResumeOrchestrationEvent(reason string) *protos.HistoryEvent

func NewScheduleTaskAction

func NewScheduleTaskAction(
	taskID int32,
	name string,
	input *wrapperspb.StringValue,
	version ...*wrapperspb.StringValue,
) *protos.OrchestratorAction

func NewSendEventAction

func NewSendEventAction(iid string, name string, data *wrapperspb.StringValue) *protos.OrchestratorAction

func NewSendEventEvent

func NewSendEventEvent(eventID int32, instanceID string, name string, rawInput *wrapperspb.StringValue) *protos.HistoryEvent

func NewSubOrchestrationCreatedEvent

func NewSubOrchestrationCreatedEvent(
	eventID int32,
	name string,
	version *wrapperspb.StringValue,
	rawInput *wrapperspb.StringValue,
	instanceID string,
	parentTraceContext *protos.TraceContext,
) *protos.HistoryEvent

func NewSuspendOrchestrationEvent added in v0.1.4

func NewSuspendOrchestrationEvent(reason string) *protos.HistoryEvent

func NewTaskCompletedEvent

func NewTaskCompletedEvent(taskID int32, result *wrapperspb.StringValue) *protos.HistoryEvent

func NewTaskFailedEvent

func NewTaskFailedEvent(taskID int32, failureDetails *protos.TaskFailureDetails) *protos.HistoryEvent

func NewTaskScheduledEvent

func NewTaskScheduledEvent(
	taskID int32,
	name string,
	version *wrapperspb.StringValue,
	rawInput *wrapperspb.StringValue,
	tc *protos.TraceContext,
) *protos.HistoryEvent

func NewTimerCreatedEvent

func NewTimerCreatedEvent(eventID int32, fireAt *timestamppb.Timestamp) *protos.HistoryEvent

func NewTimerFiredEvent

func NewTimerFiredEvent(
	timerID int32,
	fireAt *timestamppb.Timestamp,
	parentTraceContext *protos.TraceContext,
) *protos.HistoryEvent

func OrchestratorActionTraceContext

func OrchestratorActionTraceContext(parent *protos.TraceContext) (*protos.TraceContext, error)

OrchestratorActionTraceContext creates the trace context for a service-owned activity or sub-orchestration scheduling span.

func ParseEntityInstanceID

func ParseEntityInstanceID(instanceID string) (string, string, error)

ParseEntityInstanceID parses an entity instance ID in the format "@<name>@<key>".

func ToLowerInvariant

func ToLowerInvariant(s string) string

ToLowerInvariant lowercases s exactly like .NET's String.ToLowerInvariant, so entity names and operation names resolve identically across SDKs. It agrees with strings.ToLower for every code point except [dottedCapitalI].

func ToRuntimeStatusString added in v0.1.1

func ToRuntimeStatusString(status protos.OrchestrationStatus) string

func TraceContextFromSpan added in v0.1.1

func TraceContextFromSpan(span trace.Span) *protos.TraceContext

TraceContextFromSpan converts a sampled OpenTelemetry span into the W3C trace context sent to Durable Task Scheduler. Unsampled or invalid spans return nil.

func ValidateEntityName

func ValidateEntityName(name string) error

ValidateEntityName applies the durable-entity naming constraints used by the wire format.

func ValidateOrchestrationInstanceID

func ValidateOrchestrationInstanceID(instanceID string) error

ValidateOrchestrationInstanceID rejects orchestration IDs that collide with entity instance IDs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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