internal

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOutTypes

func GetOutTypes(fnType reflect.Type) []reflect.Type

GetOutTypes returns a slice of reflect.Type containing all output types of the provided function type.

func GetRemainingInTypes

func GetRemainingInTypes(fnType reflect.Type) []reflect.Type

GetRemainingInTypes returns a slice of reflect.Type containing all input types except the first one.

func NewInterface

func NewInterface(location string) workflowserviceclient.Interface

NewInterface creates a new Cadence workflow service client interface.

func UpdateWorkflowFunctionContextArgument

func UpdateWorkflowFunctionContextArgument(wf interface{}, contextType reflect.Type) interface{}

UpdateWorkflowFunctionContextArgument takes a workflow function and a new context type, and returns a new function with the same signature but with the first argument replaced by the provided context type. The rest of the arguments remain unchanged. It is useful for adapting workflow functions to different context types. The original function must have at least one argument (the context). If the original function does not have a context argument, it panics.

Types

type ActivityOptions

type ActivityOptions struct {

	// TaskList that the activity needs to be scheduled on.
	// optional: The default task list with the same name as the workflow task list.
	TaskList string

	// ScheduleToCloseTimeout - The end to end timeout for the activity needed.
	// The zero value of this uses default value.
	// Optional: The default value is the sum of ScheduleToStartTimeout and StartToCloseTimeout
	ScheduleToCloseTimeout time.Duration

	// ScheduleToStartTimeout - The queue timeout before the activity starts executed.
	// Mandatory: No default.
	ScheduleToStartTimeout time.Duration

	// StartToCloseTimeout - The timeout from the start of execution to end of it.
	// Mandatory: No default.
	StartToCloseTimeout time.Duration

	// HeartbeatTimeout - The periodic timeout while the activity is in execution. This is
	// the max interval the server needs to hear at-least one ping from the activity.
	// Optional: Default zero, means no heart beating is needed.
	HeartbeatTimeout time.Duration

	// WaitForCancellation - Whether to wait for cancelled activity to be completed(
	// activity can be failed, completed, cancel accepted)
	// Optional: default false
	WaitForCancellation bool

	// ActivityID - Business level activity ID, this is not needed for most of the cases if you have
	// to specify this then talk to cadence team. This is something will be done in future.
	// Optional: default empty string
	ActivityID string

	// RetryPolicy specify how to retry activity if error happens. When RetryPolicy.ExpirationInterval is specified
	// and it is larger than the activity's ScheduleToStartTimeout, then the ExpirationInterval will override activity's
	// ScheduleToStartTimeout. This is to avoid retrying on ScheduleToStartTimeout error which only happen when worker
	// is not picking up the task within the timeout. Retrying ScheduleToStartTimeout does not make sense as it just
	// mark the task as failed and create a new task and put back in the queue waiting worker to pick again. Cadence
	// server also make sure the ScheduleToStartTimeout will not be larger than the workflow's timeout.
	// Same apply to ScheduleToCloseTimeout. See more details about RetryPolicy on the doc for RetryPolicy.
	// Optional: default is no retry
	RetryPolicy *RetryPolicy
}

type CadenceDataConverter

type CadenceDataConverter struct {
	Logger *zap.Logger
}

CadenceDataConverter is a Cadence encoded.DataConverter that supports Starlark types, such as starlark.String, starlark.Int and others. Enables passing Starlark values between Cadence workflows and activities.

func (*CadenceDataConverter) FromData

func (s *CadenceDataConverter) FromData(data []byte, to ...any) error

FromData decodes the given byte slice into the specified values.

func (*CadenceDataConverter) ToData

func (s *CadenceDataConverter) ToData(values ...any) ([]byte, error)

ToData encodes the given values into a byte slice.

type CadenceWorker

type CadenceWorker struct {
	Worker cadworker.Worker
}

CadenceWorker implements Worker interface

func (*CadenceWorker) RegisterActivity

func (w *CadenceWorker) RegisterActivity(a interface{})

RegisterActivity registers an activity with the Cadence worker.

func (*CadenceWorker) RegisterActivityWithOptions

func (w *CadenceWorker) RegisterActivityWithOptions(runFunc interface{}, options RegisterActivityOptions)

RegisterActivityWithOptions registers an activity with the Cadence worker using options.

func (*CadenceWorker) RegisterWorkflow

func (w *CadenceWorker) RegisterWorkflow(wf interface{}, funcName string)

RegisterWorkflow registers a workflow with the Cadence worker.

func (*CadenceWorker) RegisterWorkflowWithOptions

func (w *CadenceWorker) RegisterWorkflowWithOptions(wf interface{}, options RegisterWorkflowOptions)

RegisterWorkflowWithOptions registers a workflow with the Cadence worker using options.

func (*CadenceWorker) Run

func (w *CadenceWorker) Run(_ <-chan interface{}) error

Run runs the Cadence worker.

func (*CadenceWorker) Start

func (w *CadenceWorker) Start() error

Start starts the Cadence worker.

func (*CadenceWorker) Stop

func (w *CadenceWorker) Stop()

Stop stops the Cadence worker.

type CadenceWorkflow

type CadenceWorkflow struct{}

CadenceWorkflow implements Workflow interface for Cadence.

func (CadenceWorkflow) ExecuteActivity

func (w CadenceWorkflow) ExecuteActivity(ctx Context, activity interface{}, args ...interface{}) Future

ExecuteActivity executes an activity in the Cadence workflow.

func (CadenceWorkflow) ExecuteChildWorkflow

func (w CadenceWorkflow) ExecuteChildWorkflow(ctx Context, childWorkflow interface{}, args ...interface{}) ChildWorkflowFuture

ExecuteChildWorkflow executes a child workflow in the Cadence workflow.

func (CadenceWorkflow) GetActivityLogger

func (w CadenceWorkflow) GetActivityLogger(ctx context.Context) *zap.Logger

GetActivityLogger is implemented in the Workflow interface to return the logger for the Cadence activity.

func (CadenceWorkflow) GetInfo

func (w CadenceWorkflow) GetInfo(ctx Context) IInfo

GetActivityInfo returns the activity info for the Cadence workflow.

func (CadenceWorkflow) GetLogger

func (w CadenceWorkflow) GetLogger(ctx Context) *zap.Logger

GetLogger is implemented in the Workflow interface to return the logger for the Cadence workflow.

func (CadenceWorkflow) GetMetricsScope

func (w CadenceWorkflow) GetMetricsScope(ctx Context) interface{}

GetMetricsScope returns the metrics scope for the Cadence workflow.

func (CadenceWorkflow) Go

func (w CadenceWorkflow) Go(ctx Context, f func(ctx Context))

Go executes a function in the Cadence workflow context.

func (CadenceWorkflow) IsCanceledError

func (w CadenceWorkflow) IsCanceledError(ctx Context, err error) bool

IsCanceledError checks if the error is a CanceledError.

func (CadenceWorkflow) NewCustomError

func (w CadenceWorkflow) NewCustomError(reason string, details ...interface{}) CustomError

NewCustomError creates a new custom error for the Cadence workflow.

func (CadenceWorkflow) NewDisconnectedContext

func (w CadenceWorkflow) NewDisconnectedContext(parent Context) (ctx Context, cancel func())

NewDisconnectedContext creates a new disconnected context for the Cadence workflow.

func (CadenceWorkflow) NewFuture

func (w CadenceWorkflow) NewFuture(ctx Context) (Future, Settable)

NewFuture creates a new future for the Cadence workflow.

func (CadenceWorkflow) Now

func (w CadenceWorkflow) Now(ctx Context) time.Time

Now returns the current time in the Cadence workflow context.

func (CadenceWorkflow) SetQueryHandler

func (w CadenceWorkflow) SetQueryHandler(ctx Context, queryType string, handler interface{}) error

SetQueryHandler sets a query handler for the Cadence workflow.

func (CadenceWorkflow) SideEffect

func (w CadenceWorkflow) SideEffect(ctx Context, f func(ctx Context) interface{}) encoded.Value

SideEffect executes a side effect in the Cadence workflow context.

func (CadenceWorkflow) Sleep

func (w CadenceWorkflow) Sleep(ctx Context, d time.Duration) (err error)

Sleep pauses the Cadence workflow for a specified duration.

func (*CadenceWorkflow) WithActivityOptions

func (w *CadenceWorkflow) WithActivityOptions(ctx Context, options ActivityOptions) Context

WithActivityOptions sets the activity options for the Cadence workflow context.

func (CadenceWorkflow) WithChildOptions

func (w CadenceWorkflow) WithChildOptions(ctx Context, cwo ChildWorkflowOptions) Context

WithChildOptions sets the child workflow options for the Cadence workflow context.

func (CadenceWorkflow) WithRetryPolicy

func (w CadenceWorkflow) WithRetryPolicy(ctx Context, retryPolicy RetryPolicy) Context

WithRetryPolicy sets the retry policy for the Cadence workflow context.

func (*CadenceWorkflow) WithTaskList

func (w *CadenceWorkflow) WithTaskList(ctx Context, name string) Context

WithTaskList sets the task list for the Cadence workflow context.

func (CadenceWorkflow) WithValue

func (w CadenceWorkflow) WithValue(parent Context, key interface{}, val interface{}) Context

WithValue sets a value in the Cadence workflow context.

func (CadenceWorkflow) WithWorkflowDomain

func (w CadenceWorkflow) WithWorkflowDomain(ctx Context, name string) Context

WithWorkflowDomain sets the workflow domain for the Cadence workflow context.

func (CadenceWorkflow) WithWorkflowTaskList

func (w CadenceWorkflow) WithWorkflowTaskList(ctx Context, name string) Context

WithWorkflowTaskList sets the workflow task list for the Cadence workflow context.

type CanceledError

type CanceledError interface {
	Error() string
	HasDetails() bool
	Details(d ...interface{}) error
}

type ChildWorkflowFuture

type ChildWorkflowFuture interface {
	Future
	// GetChildWorkflowExecution returns a future that will be ready when child workflow execution started. You can
	// get the WorkflowExecution of the child workflow from the future. Then you can use Workflow ID and RunID of
	// child workflow to cancel or send signal to child workflow.
	//  childWorkflowFuture := workflow.ExecuteChildWorkflow(ctx, child, ...)
	//  var childWE WorkflowExecution
	//  if err := childWorkflowFuture.GetChildWorkflowExecution().Get(ctx, &childWE); err == nil {
	//      // child workflow started, you can use childWE to get the WorkflowID and RunID of child workflow
	//  }
	GetChildWorkflowExecution() Future

	// SignalWorkflowByID sends a signal to the child workflow. This call will block until child workflow is started.
	SignalChildWorkflow(ctx Context, signalName string, data interface{}) Future
}

type ChildWorkflowOptions

type ChildWorkflowOptions struct {
	// Domain of the child workflow.
	// Optional: the current workflow (parent)'s domain will be used if this is not provided.
	Domain string

	// WorkflowID of the child workflow to be scheduled.
	// Optional: an auto generated workflowID will be used if this is not provided.
	WorkflowID string

	// TaskList that the child workflow needs to be scheduled on.
	// Optional: the parent workflow task list will be used if this is not provided.
	TaskList string

	// ExecutionStartToCloseTimeout - The end to end timeout for the child workflow execution.
	// Mandatory: no default
	ExecutionStartToCloseTimeout time.Duration

	// TaskStartToCloseTimeout - The decision task timeout for the child workflow.
	// Optional: default is 10s if this is not provided (or if 0 is provided).
	TaskStartToCloseTimeout time.Duration

	// WaitForCancellation - Whether to wait for cancelled child workflow to be ended (child workflow can be ended
	// as: completed/failed/timedout/terminated/canceled)
	// Optional: default false
	WaitForCancellation bool

	// WorkflowIDReusePolicy - Whether server allow reuse of workflow ID, can be useful
	// for dedup logic if set to WorkflowIdReusePolicyRejectDuplicate
	// Here the value we use Cadence constant, and we map to Temporal equivalent based on the table below.
	//               Cadence Constant	             Value	Meaning	Temporal Equivalent	Value
	//----------------------------------------------------------------------------------------------------
	//WorkflowIDReusePolicyAllowDuplicateFailedOnly	   0	Allow reuse if last run was terminated/cancelled/timeouted/failed	WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY	2
	//WorkflowIDReusePolicyAllowDuplicate	           1	Allow reuse as long as workflow is not running	WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE	1
	//WorkflowIDReusePolicyRejectDuplicate	           2	Never allow reuse	WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE	3
	//WorkflowIDReusePolicyTerminateIfRunning	       3	Terminate if running, then start new	WORKFLOW_ID_REUSE_POLICY_TERMINATE_IF_RUNNING
	//----------------------------------------------------------------------------------------------------
	WorkflowIDReusePolicy int

	// RetryPolicy specify how to retry child workflow if error happens.
	// Optional: default is no retry
	RetryPolicy *RetryPolicy

	// CronSchedule - Optional cron schedule for workflow. If a cron schedule is specified, the workflow will run
	// as a cron based on the schedule. The scheduling will be based on UTC time. Schedule for next run only happen
	// after the current run is completed/failed/timeout. If a RetryPolicy is also supplied, and the workflow failed
	// or timeout, the workflow will be retried based on the retry policy. While the workflow is retrying, it won't
	// schedule its next run. If next schedule is due while workflow is running (or retrying), then it will skip that
	// schedule. Cron workflow will not stop until it is terminated or cancelled (by returning cadence.CanceledError).
	// The cron spec is as following:
	// ┌───────────── minute (0 - 59)
	// │ ┌───────────── hour (0 - 23)
	// │ │ ┌───────────── day of the month (1 - 31)
	// │ │ │ ┌───────────── month (1 - 12)
	// │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday)
	// │ │ │ │ │
	// │ │ │ │ │
	// * * * * *
	CronSchedule string

	// Memo - Optional non-indexed info that will be shown in list workflow.
	Memo map[string]interface{}

	// SearchAttributes - Optional indexed info that can be used in query of List/Scan/Count workflow APIs (only
	// supported when Cadence server is using ElasticSearch). The key and value type must be registered on Cadence server side.
	// Use GetSearchAttributes API to get valid key and corresponding value type.
	SearchAttributes map[string]interface{}

	// ParentClosePolicy - Optional policy to decide what to do for the child.
	// Default is Terminate (if onboarded to this feature)
	ParentClosePolicy int
}

type Context

type Context interface {
	Value(key interface{}) interface{}
}

Context defines the methods that a workflow.Context should implement.

type CustomError

type CustomError interface {
	Error() string
	Reason() string
	HasDetails() bool
	Details(d ...interface{}) error
}

type Future

type Future interface {
	Get(ctx Context, valuePtr interface{}) error
	// IsReady will return true Get is guaranteed to not block.
	IsReady() bool
}

type IChannel

type IChannel interface {
	Receive(ctx Context, valuePtr interface{}) (ok bool)

	ReceiveAsync(valuePtr interface{}) (ok bool)
	ReceiveAsyncWithMoreFlag(valuePtr interface{}) (ok bool, more bool)
	Send(ctx Context, v interface{})

	SendAsync(v interface{}) (ok bool)
	Close()
}

Package internal provides the interface for the Cadence worker and workflow IChannel is an interface that defines the methods for sending and receiving

type IInfo

type IInfo interface {
	ExecutionID() string
	RunID() string
}

type RegisterActivityOptions

type RegisterActivityOptions struct {
	// When an activity is a function the name is an actual activity type name.
	// When an activity is part of a structure then each member of the structure becomes an activity with
	// this Name as a prefix + activity function name.
	Name string
	// Activity type name is equal to function name instead of fully qualified
	// name including function package (and struct type if used).
	// This option has no effect when explicit Name is provided.
	EnableShortName               bool
	DisableAlreadyRegisteredCheck bool
	// Automatically send heartbeats for this activity at an interval that is less than the HeartbeatTimeout.
	// This option has no effect if the activity is executed with a HeartbeatTimeout of 0.
	// Default: false
	EnableAutoHeartbeat bool
	// This is for temporal activity RegisterOptions
	// When registering a struct with activities, skip functions that are not valid activities. If false,
	// registration panics.
	SkipInvalidStructFunctions bool
}

type RegisterWorkflowOptions

type RegisterWorkflowOptions struct {
	Name string
	// Workflow type name is equal to function name instead of fully qualified name including function package.
	// This option has no effect when explicit Name is provided.
	EnableShortName               bool
	DisableAlreadyRegisteredCheck bool
	// This is for temporal RegisterOptions
	// Optional: Provides a Versioning Behavior to workflows of this type. It is required
	// when WorkerOptions does not specify [DeploymentOptions.DefaultVersioningBehavior],
	// [DeploymentOptions.DeploymentSeriesName] is set, and [UseBuildIDForVersioning] is true.
	// NOTE: Experimental
	VersioningBehavior int
}

type RetryPolicy

type RetryPolicy struct {
	// Backoff interval for the first retry. If coefficient is 1.0 then it is used for all retries.
	// Required, no default value.
	InitialInterval time.Duration

	// Coefficient used to calculate the next retry backoff interval.
	// The next retry interval is previous interval multiplied by this coefficient.
	// Must be 1 or larger. Default is 2.0.
	BackoffCoefficient float64

	// Maximum backoff interval between retries. Exponential backoff leads to interval increase.
	// This value is the cap of the interval. Default is 100x of initial interval.
	MaximumInterval time.Duration

	// Maximum time to retry. Either ExpirationInterval or MaximumAttempts is required.
	// When exceeded the retries stop even if maximum retries is not reached yet.
	ExpirationInterval time.Duration

	// Maximum number of attempts. When exceeded the retries stop even if not expired yet.
	// If not set or set to 0, it means unlimited, and rely on ExpirationInterval to stop.
	// Either MaximumAttempts or ExpirationInterval is required.
	MaximumAttempts int32

	// Non-Retriable errors. This is optional. Cadence server will stop retry if error reason matches this list.
	// Error reason for custom error is specified when your activity/workflow return cadence.NewCustomError(reason).
	// Error reason for panic error is "cadenceInternal:Panic".
	// Error reason for any other error is "cadenceInternal:Generic".
	// Error reason for timeouts is: "cadenceInternal:Timeout TIMEOUT_TYPE". TIMEOUT_TYPE could be START_TO_CLOSE or HEARTBEAT.
	// Note, cancellation is not a failure, so it won't be retried.
	NonRetriableErrorReasons []string
}

type Settable

type Settable interface {
	Set(value interface{}, err error)
	SetValue(value interface{})
	SetError(err error)
	Chain(future Future) // Value (or error) of the future become the same of the chained one.
}

type TemporalCanceledError

type TemporalCanceledError struct {
	temporal.CanceledError
}

func (TemporalCanceledError) Details

func (e TemporalCanceledError) Details(d ...interface{}) error

Details extracts strong typed detail data of this error.

func (TemporalCanceledError) Error

func (e TemporalCanceledError) Error() string

Error from error interface

func (TemporalCanceledError) HasDetails

func (e TemporalCanceledError) HasDetails() bool

HasDetails return if this error has strong typed detail data.

type TemporalCustomError

type TemporalCustomError struct {
	temporal.ApplicationError
}

func (TemporalCustomError) Details

func (e TemporalCustomError) Details(d ...interface{}) error

Details extracts strong typed detail data of this custom error. If there is no details, it will return ErrNoData.

func (TemporalCustomError) Error

func (e TemporalCustomError) Error() string

func (TemporalCustomError) HasDetails

func (e TemporalCustomError) HasDetails() bool

HasDetails return if this error has strong typed detail data.

func (TemporalCustomError) Reason

func (e TemporalCustomError) Reason() string

Reason gets the reason of this custom error

type TemporalDataConverter

type TemporalDataConverter struct {
	Logger *zap.Logger
}

TemporalDataConverter is a Temporal TemporalDataConverter that supports Starlark types. Enables passing Starlark values between Temporal workflows and activities.

func (TemporalDataConverter) FromPayload

func (s TemporalDataConverter) FromPayload(payload *commonpb.Payload, to interface{}) error

FromPayload converts a single Temporal Payload back to a Go value

func (TemporalDataConverter) FromPayloads

func (s TemporalDataConverter) FromPayloads(payloads *commonpb.Payloads, to ...interface{}) error

FromPayloads converts Temporal Payloads back into Go types

func (TemporalDataConverter) ToPayload

func (s TemporalDataConverter) ToPayload(value interface{}) (*commonpb.Payload, error)

ToPayload converts a single Go value to a Temporal Payload

func (TemporalDataConverter) ToPayloads

func (s TemporalDataConverter) ToPayloads(values ...interface{}) (*commonpb.Payloads, error)

ToPayloads converts input values to Temporal's Payloads format

func (TemporalDataConverter) ToString

func (s TemporalDataConverter) ToString(payload *commonpb.Payload) string

ToString converts a single Payload to a human-readable string.

func (TemporalDataConverter) ToStrings

func (s TemporalDataConverter) ToStrings(payloads *commonpb.Payloads) []string

ToStrings converts a *commonpb.Payloads object into a slice of human-readable strings.

type TemporalWorker

type TemporalWorker struct {
	Worker tmpworker.Worker
}

TemporalWorker is a wrapper around the Temporal SDK worker interface.

func (*TemporalWorker) RegisterActivity

func (tw *TemporalWorker) RegisterActivity(a interface{})

RegisterActivity registers an activity with the Temporal worker.

func (*TemporalWorker) RegisterActivityWithOptions

func (tw *TemporalWorker) RegisterActivityWithOptions(w interface{}, options RegisterActivityOptions)

RegisterActivityWithOptions registers an activity with the Temporal worker using options.

func (*TemporalWorker) RegisterWorkflow

func (tw *TemporalWorker) RegisterWorkflow(wf interface{}, funcName string)

RegisterWorkflow registers a workflow with the Temporal worker.

func (*TemporalWorker) RegisterWorkflowWithOptions

func (tw *TemporalWorker) RegisterWorkflowWithOptions(wf interface{}, options RegisterWorkflowOptions)

RegisterWorkflowWithOptions registers a workflow with the Temporal worker using options.

func (*TemporalWorker) Run

func (tw *TemporalWorker) Run(interruptCh <-chan interface{}) error

Run runs the Temporal worker and blocks until it is interrupted.

func (*TemporalWorker) Start

func (tw *TemporalWorker) Start() error

Start starts the Temporal worker.

func (*TemporalWorker) Stop

func (tw *TemporalWorker) Stop()

Stop stops the Temporal worker.

type TemporalWorkflow

type TemporalWorkflow struct{}

TemporalWorkflow is a wrapper around the Temporal SDK workflow interface.

func (TemporalWorkflow) ExecuteActivity

func (w TemporalWorkflow) ExecuteActivity(ctx Context, activity interface{}, args ...interface{}) Future

func (TemporalWorkflow) ExecuteChildWorkflow

func (w TemporalWorkflow) ExecuteChildWorkflow(ctx Context, name interface{}, args ...interface{}) ChildWorkflowFuture

func (TemporalWorkflow) GetActivityLogger

func (w TemporalWorkflow) GetActivityLogger(ctx context.Context) *zap.Logger

func (TemporalWorkflow) GetInfo

func (w TemporalWorkflow) GetInfo(ctx Context) IInfo

func (TemporalWorkflow) GetLogger

func (w TemporalWorkflow) GetLogger(ctx Context) *zap.Logger

func (TemporalWorkflow) GetMetricsScope

func (w TemporalWorkflow) GetMetricsScope(ctx Context) interface{}

func (TemporalWorkflow) Go

func (w TemporalWorkflow) Go(ctx Context, f func(ctx Context))

func (TemporalWorkflow) IsCanceledError

func (w TemporalWorkflow) IsCanceledError(ctx Context, err error) bool

IsCanceledError checks if the error is a CanceledError.

func (TemporalWorkflow) NewCustomError

func (w TemporalWorkflow) NewCustomError(reason string, details ...interface{}) CustomError

func (TemporalWorkflow) NewDisconnectedContext

func (w TemporalWorkflow) NewDisconnectedContext(parent Context) (ctx Context, cancel func())

func (TemporalWorkflow) NewFuture

func (w TemporalWorkflow) NewFuture(ctx Context) (Future, Settable)

func (TemporalWorkflow) Now

func (w TemporalWorkflow) Now(ctx Context) time.Time

func (TemporalWorkflow) SetQueryHandler

func (w TemporalWorkflow) SetQueryHandler(ctx Context, queryType string, handler interface{}) error

func (TemporalWorkflow) SideEffect

func (w TemporalWorkflow) SideEffect(ctx Context, f func(ctx Context) interface{}) encoded.Value

func (TemporalWorkflow) Sleep

func (w TemporalWorkflow) Sleep(ctx Context, d time.Duration) (err error)

func (*TemporalWorkflow) WithActivityOptions

func (w *TemporalWorkflow) WithActivityOptions(ctx Context, options ActivityOptions) Context

func (TemporalWorkflow) WithChildOptions

func (w TemporalWorkflow) WithChildOptions(ctx Context, cwo ChildWorkflowOptions) Context

WithChildOptions sets the child workflow options for the workflow execution.

func (TemporalWorkflow) WithRetryPolicy

func (w TemporalWorkflow) WithRetryPolicy(ctx Context, retryPolicy RetryPolicy) Context

WithRetryPolicy sets the retry policy for the workflow execution.

func (*TemporalWorkflow) WithTaskList

func (w *TemporalWorkflow) WithTaskList(ctx Context, name string) Context

func (TemporalWorkflow) WithValue

func (w TemporalWorkflow) WithValue(parent Context, key interface{}, val interface{}) Context

func (TemporalWorkflow) WithWorkflowDomain

func (w TemporalWorkflow) WithWorkflowDomain(ctx Context, name string) Context

func (TemporalWorkflow) WithWorkflowTaskList

func (w TemporalWorkflow) WithWorkflowTaskList(ctx Context, name string) Context

type Workflow

type Workflow interface {
	GetLogger(ctx Context) *zap.Logger
	GetActivityLogger(ctx context.Context) *zap.Logger
	WithValue(parent Context, key interface{}, val interface{}) Context
	NewDisconnectedContext(parent Context) (ctx Context, cancel func())
	GetMetricsScope(ctx Context) interface{}
	ExecuteActivity(ctx Context, activity interface{}, args ...interface{}) Future
	WithTaskList(ctx Context, name string) Context
	GetInfo(ctx Context) IInfo
	WithActivityOptions(ctx Context, options ActivityOptions) Context
	WithChildOptions(ctx Context, cwo ChildWorkflowOptions) Context
	SetQueryHandler(ctx Context, queryType string, handler interface{}) error
	WithWorkflowDomain(ctx Context, name string) Context
	WithWorkflowTaskList(ctx Context, name string) Context
	ExecuteChildWorkflow(ctx Context, childWorkflow interface{}, args ...interface{}) ChildWorkflowFuture
	NewCustomError(reason string, details ...interface{}) CustomError
	NewFuture(ctx Context) (Future, Settable)
	Go(ctx Context, f func(ctx Context))
	SideEffect(ctx Context, f func(ctx Context) interface{}) encoded.Value
	Now(ctx Context) time.Time
	Sleep(ctx Context, d time.Duration) (err error)
	IsCanceledError(ctx Context, err error) bool
	WithRetryPolicy(ctx Context, retryPolicy RetryPolicy) Context
}

type ZapLoggerAdapter

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

func NewZapLoggerAdapter

func NewZapLoggerAdapter(z *zap.Logger) *ZapLoggerAdapter

func (*ZapLoggerAdapter) Debug

func (l *ZapLoggerAdapter) Debug(msg string, keyvals ...interface{})

Implement go.temporal.io/sdk/log.Logger

func (*ZapLoggerAdapter) Error

func (l *ZapLoggerAdapter) Error(msg string, keyvals ...interface{})

func (*ZapLoggerAdapter) Info

func (l *ZapLoggerAdapter) Info(msg string, keyvals ...interface{})

func (*ZapLoggerAdapter) Warn

func (l *ZapLoggerAdapter) Warn(msg string, keyvals ...interface{})

func (*ZapLoggerAdapter) With

func (l *ZapLoggerAdapter) With(keyvals ...interface{}) log.Logger

func (*ZapLoggerAdapter) Zap

func (l *ZapLoggerAdapter) Zap() *zap.Logger

Expose the underlying *zap.Logger

Jump to

Keyboard shortcuts

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