updatabletimerv1

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

Code generated by protoc-gen-go_temporal. DO NOT EDIT. versions:

protoc-gen-go_temporal 1.13.1-next (b7a15c407f9a9490670a48b7f288c936cdd1bc48)
go go1.22.3
protoc (unknown)

source: example/updatabletimer/v1/updatabletimer.proto

Index

Constants

View Source
const ExampleTaskQueue = "updatable-timer"

ExampleTaskQueue is the default task-queue for a example.updatabletimer.v1.Example worker

View Source
const (
	GetWakeUpTimeQueryName = "example.updatabletimer.v1.Example.GetWakeUpTime"
)

example.updatabletimer.v1.Example query names

View Source
const (
	UpdatableTimerWorkflowName = "UpdatableTimer"
)

example.updatabletimer.v1.Example workflow names

View Source
const (
	UpdateWakeUpTimeSignalName = "example.updatabletimer.v1.Example.UpdateWakeUpTime"
)

example.updatabletimer.v1.Example signal names

Variables

View Source
var File_example_updatabletimer_v1_updatabletimer_proto protoreflect.FileDescriptor
View Source
var (
	// UpdatableTimer describes an updatable timer workflow
	UpdatableTimerFunction func(workflow.Context, *UpdatableTimerInput) error
)

Reference to generated workflow functions

View Source
var (
	UpdatableTimerIdexpression = expression.MustParseExpression("updatable-timer/${! name.or(uuid_v4()) }")
)

example.updatabletimer.v1.Example workflow id expressions

Functions

func NewExampleCli

func NewExampleCli(options ...*ExampleCliOptions) (*v2.App, error)

NewExampleCli initializes a cli for a(n) example.updatabletimer.v1.Example service

func NewExampleCliCommand

func NewExampleCliCommand(options ...*ExampleCliOptions) (*v2.Command, error)

NewExampleCliCommand initializes a cli command for a example.updatabletimer.v1.Example service with subcommands for each query, signal, update, and workflow

func NewExampleClientOptions

func NewExampleClientOptions() *exampleClientOptions

NewExampleClientOptions initializes a new exampleClientOptions value

func RegisterExampleActivities

func RegisterExampleActivities(r worker.ActivityRegistry, activities ExampleActivities)

RegisterExampleActivities registers activities with a worker

func RegisterExampleWorkflows

func RegisterExampleWorkflows(r worker.WorkflowRegistry, workflows ExampleWorkflows)

RegisterExampleWorkflows registers example.updatabletimer.v1.Example workflows with the given worker

func RegisterUpdatableTimerWorkflow

func RegisterUpdatableTimerWorkflow(r worker.WorkflowRegistry, wf func(workflow.Context, *UpdatableTimerWorkflowInput) (UpdatableTimerWorkflow, error))

RegisterUpdatableTimerWorkflow registers a example.updatabletimer.v1.Example.UpdatableTimer workflow with the given worker

func UpdatableTimerChild

func UpdatableTimerChild(ctx workflow.Context, req *UpdatableTimerInput, options ...*UpdatableTimerChildOptions) error

UpdatableTimer describes an updatable timer workflow

func UpdateWakeUpTimeExternal

func UpdateWakeUpTimeExternal(ctx workflow.Context, workflowID string, runID string, req *UpdateWakeUpTimeInput) error

UpdateWakeUpTime updates the timer expiration timestamp

func UpdateWakeUpTimeExternalAsync

func UpdateWakeUpTimeExternalAsync(ctx workflow.Context, workflowID string, runID string, req *UpdateWakeUpTimeInput) workflow.Future

UpdateWakeUpTime updates the timer expiration timestamp

func WithExampleSchemeTypes

func WithExampleSchemeTypes() scheme.Option

WithExampleSchemeTypes registers all Example protobuf types with the given scheme

Types

type ExampleActivities

type ExampleActivities interface{}

ExampleActivities describes available worker activities

type ExampleCliOptions

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

ExampleCliOptions describes runtime configuration for example.updatabletimer.v1.Example cli

func NewExampleCliOptions

func NewExampleCliOptions() *ExampleCliOptions

NewExampleCliOptions initializes a new ExampleCliOptions value

func (*ExampleCliOptions) WithAfter

func (opts *ExampleCliOptions) WithAfter(fn func(*v2.Context) error) *ExampleCliOptions

WithAfter injects a custom After hook to be run after any command invocation

func (*ExampleCliOptions) WithBefore

func (opts *ExampleCliOptions) WithBefore(fn func(*v2.Context) error) *ExampleCliOptions

WithBefore injects a custom Before hook to be run prior to any command invocation

func (*ExampleCliOptions) WithClient

func (opts *ExampleCliOptions) WithClient(fn func(*v2.Context) (client.Client, error)) *ExampleCliOptions

WithClient provides a Temporal client factory for use by commands

func (*ExampleCliOptions) WithWorker

func (opts *ExampleCliOptions) WithWorker(fn func(*v2.Context, client.Client) (worker.Worker, error)) *ExampleCliOptions

WithWorker provides an method for initializing a worker

type ExampleClient

type ExampleClient interface {
	// UpdatableTimer describes an updatable timer workflow
	UpdatableTimer(ctx context.Context, req *UpdatableTimerInput, opts ...*UpdatableTimerOptions) error

	// UpdatableTimerAsync starts a(n) UpdatableTimer workflow and returns a handle to the workflow run
	UpdatableTimerAsync(ctx context.Context, req *UpdatableTimerInput, opts ...*UpdatableTimerOptions) (UpdatableTimerRun, error)

	// GetUpdatableTimer retrieves a handle to an existing UpdatableTimer workflow execution
	GetUpdatableTimer(ctx context.Context, workflowID string, runID string) UpdatableTimerRun

	// CancelWorkflow requests cancellation of an existing workflow execution
	CancelWorkflow(ctx context.Context, workflowID string, runID string) error

	// TerminateWorkflow an existing workflow execution
	TerminateWorkflow(ctx context.Context, workflowID string, runID string, reason string, details ...interface{}) error

	// GetWakeUpTime retrieves the current timer expiration timestamp
	GetWakeUpTime(ctx context.Context, workflowID string, runID string) (*GetWakeUpTimeOutput, error)

	// UpdateWakeUpTime updates the timer expiration timestamp
	UpdateWakeUpTime(ctx context.Context, workflowID string, runID string, signal *UpdateWakeUpTimeInput) error
}

ExampleClient describes a client for a(n) example.updatabletimer.v1.Example worker

func NewExampleClient

func NewExampleClient(c client.Client, options ...*exampleClientOptions) ExampleClient

NewExampleClient initializes a new example.updatabletimer.v1.Example client

func NewExampleClientWithOptions

func NewExampleClientWithOptions(c client.Client, opts client.Options, options ...*exampleClientOptions) (ExampleClient, error)

NewExampleClientWithOptions initializes a new Example client with the given options

type ExampleWorkflowFunctions added in v1.12.0

type ExampleWorkflowFunctions interface {
	// UpdatableTimer describes an updatable timer workflow
	UpdatableTimer(workflow.Context, *UpdatableTimerInput) error
}

ExampleWorkflowFunctions describes a mockable dependency for inlining workflows within other workflows

func NewExampleWorkflowFunctions added in v1.12.0

func NewExampleWorkflowFunctions() ExampleWorkflowFunctions

type ExampleWorkflows

type ExampleWorkflows interface {
	// UpdatableTimer describes an updatable timer workflow
	UpdatableTimer(ctx workflow.Context, input *UpdatableTimerWorkflowInput) (UpdatableTimerWorkflow, error)
}

ExampleWorkflows provides methods for initializing new example.updatabletimer.v1.Example workflow values

type GetWakeUpTimeOutput

type GetWakeUpTimeOutput struct {
	WakeUpTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=wake_up_time,json=wakeUpTime,proto3" json:"wake_up_time,omitempty"`
	// contains filtered or unexported fields
}

GetWakeUpTimeOutput describes the input to a GetWakeUpTime query

func (*GetWakeUpTimeOutput) Descriptor deprecated

func (*GetWakeUpTimeOutput) Descriptor() ([]byte, []int)

Deprecated: Use GetWakeUpTimeOutput.ProtoReflect.Descriptor instead.

func (*GetWakeUpTimeOutput) GetWakeUpTime

func (x *GetWakeUpTimeOutput) GetWakeUpTime() *timestamppb.Timestamp

func (*GetWakeUpTimeOutput) ProtoMessage

func (*GetWakeUpTimeOutput) ProtoMessage()

func (*GetWakeUpTimeOutput) ProtoReflect

func (x *GetWakeUpTimeOutput) ProtoReflect() protoreflect.Message

func (*GetWakeUpTimeOutput) Reset

func (x *GetWakeUpTimeOutput) Reset()

func (*GetWakeUpTimeOutput) String

func (x *GetWakeUpTimeOutput) String() string

type TestExampleClient

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

TestClient provides a testsuite-compatible Client

func NewTestExampleClient

func NewTestExampleClient(env *testsuite.TestWorkflowEnvironment, workflows ExampleWorkflows, activities ExampleActivities) *TestExampleClient

NewTestExampleClient initializes a new TestExampleClient value

func (*TestExampleClient) CancelWorkflow

func (c *TestExampleClient) CancelWorkflow(ctx context.Context, workflowID string, runID string) error

CancelWorkflow requests cancellation of an existing workflow execution

func (*TestExampleClient) GetUpdatableTimer

func (c *TestExampleClient) GetUpdatableTimer(ctx context.Context, workflowID string, runID string) UpdatableTimerRun

GetUpdatableTimer is a noop

func (*TestExampleClient) GetWakeUpTime

func (c *TestExampleClient) GetWakeUpTime(ctx context.Context, workflowID string, runID string) (*GetWakeUpTimeOutput, error)

GetWakeUpTime executes a example.updatabletimer.v1.Example.GetWakeUpTime query

func (*TestExampleClient) TerminateWorkflow

func (c *TestExampleClient) TerminateWorkflow(ctx context.Context, workflowID string, runID string, reason string, details ...interface{}) error

TerminateWorkflow terminates an existing workflow execution

func (*TestExampleClient) UpdatableTimer

func (c *TestExampleClient) UpdatableTimer(ctx context.Context, req *UpdatableTimerInput, opts ...*UpdatableTimerOptions) error

UpdatableTimer executes a(n) UpdatableTimer workflow in the test environment

func (*TestExampleClient) UpdatableTimerAsync

func (c *TestExampleClient) UpdatableTimerAsync(ctx context.Context, req *UpdatableTimerInput, options ...*UpdatableTimerOptions) (UpdatableTimerRun, error)

UpdatableTimerAsync executes a(n) UpdatableTimer workflow in the test environment

func (*TestExampleClient) UpdateWakeUpTime

func (c *TestExampleClient) UpdateWakeUpTime(ctx context.Context, workflowID string, runID string, req *UpdateWakeUpTimeInput) error

UpdateWakeUpTime executes a example.updatabletimer.v1.Example.UpdateWakeUpTime signal

type UpdatableTimerChildOptions

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

UpdatableTimerChildOptions provides configuration for a child UpdatableTimer workflow operation

func NewUpdatableTimerChildOptions

func NewUpdatableTimerChildOptions() *UpdatableTimerChildOptions

NewUpdatableTimerChildOptions initializes a new UpdatableTimerChildOptions value

func (*UpdatableTimerChildOptions) Build added in v1.13.0

Build initializes a new go.temporal.io/sdk/workflow.ChildWorkflowOptions value with defaults and overrides applied

func (*UpdatableTimerChildOptions) WithChildWorkflowOptions

WithChildWorkflowOptions sets the initial go.temporal.io/sdk/workflow.ChildWorkflowOptions

func (*UpdatableTimerChildOptions) WithExecutionTimeout added in v1.13.0

WithExecutionTimeout sets the WorkflowExecutionTimeout value

func (*UpdatableTimerChildOptions) WithID added in v1.13.0

WithID sets the WorkflowID value

func (*UpdatableTimerChildOptions) WithIDReusePolicy added in v1.13.0

WithIDReusePolicy sets the WorkflowIDReusePolicy value

func (*UpdatableTimerChildOptions) WithParentClosePolicy added in v1.13.0

WithParentClosePolicy sets the WorkflowIDReusePolicy value

func (*UpdatableTimerChildOptions) WithRetryPolicy added in v1.13.0

WithRetryPolicy sets the RetryPolicy value

func (*UpdatableTimerChildOptions) WithRunTimeout added in v1.13.0

WithRunTimeout sets the WorkflowRunTimeout value

func (*UpdatableTimerChildOptions) WithSearchAttributes added in v1.13.0

func (o *UpdatableTimerChildOptions) WithSearchAttributes(sa map[string]any) *UpdatableTimerChildOptions

WithSearchAttributes sets the SearchAttributes value

func (*UpdatableTimerChildOptions) WithTaskQueue added in v1.13.0

WithTaskQueue sets the TaskQueue value

func (*UpdatableTimerChildOptions) WithTaskTimeout added in v1.13.0

WithTaskTimeout sets the WorkflowTaskTimeout value

func (*UpdatableTimerChildOptions) WithWaitForCancellation added in v1.13.0

func (o *UpdatableTimerChildOptions) WithWaitForCancellation(wait bool) *UpdatableTimerChildOptions

WithWaitForCancellation sets the WaitForCancellation value

type UpdatableTimerChildRun

type UpdatableTimerChildRun struct {
	Future workflow.ChildWorkflowFuture
}

UpdatableTimerChildRun describes a child UpdatableTimer workflow run

func UpdatableTimerChildAsync

func UpdatableTimerChildAsync(ctx workflow.Context, req *UpdatableTimerInput, options ...*UpdatableTimerChildOptions) (*UpdatableTimerChildRun, error)

UpdatableTimer describes an updatable timer workflow

func (*UpdatableTimerChildRun) Get

Get blocks until the workflow is completed, returning the response value

func (*UpdatableTimerChildRun) Select

Select adds this completion to the selector. Callback can be nil.

func (*UpdatableTimerChildRun) SelectStart

SelectStart adds waiting for start to the selector. Callback can be nil.

func (*UpdatableTimerChildRun) UpdateWakeUpTime

func (r *UpdatableTimerChildRun) UpdateWakeUpTime(ctx workflow.Context, input *UpdateWakeUpTimeInput) error

UpdateWakeUpTime sends a(n) "example.updatabletimer.v1.Example.UpdateWakeUpTime" signal request to the child workflow

func (*UpdatableTimerChildRun) UpdateWakeUpTimeAsync

func (r *UpdatableTimerChildRun) UpdateWakeUpTimeAsync(ctx workflow.Context, input *UpdateWakeUpTimeInput) workflow.Future

UpdateWakeUpTimeAsync sends a(n) "example.updatabletimer.v1.Example.UpdateWakeUpTime" signal request to the child workflow

func (*UpdatableTimerChildRun) WaitStart

WaitStart waits for the child workflow to start

type UpdatableTimerInput

type UpdatableTimerInput struct {
	InitialWakeUpTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=initial_wake_up_time,json=initialWakeUpTime,proto3" json:"initial_wake_up_time,omitempty"`
	Name              string                 `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

UpdatableTimerInput describes the input to a UpdatableTimer workflow

func UnmarshalCliFlagsToUpdatableTimerInput

func UnmarshalCliFlagsToUpdatableTimerInput(cmd *v2.Context) (*UpdatableTimerInput, error)

UnmarshalCliFlagsToUpdatableTimerInput unmarshals a UpdatableTimerInput from command line flags

func (*UpdatableTimerInput) Descriptor deprecated

func (*UpdatableTimerInput) Descriptor() ([]byte, []int)

Deprecated: Use UpdatableTimerInput.ProtoReflect.Descriptor instead.

func (*UpdatableTimerInput) GetInitialWakeUpTime

func (x *UpdatableTimerInput) GetInitialWakeUpTime() *timestamppb.Timestamp

func (*UpdatableTimerInput) GetName

func (x *UpdatableTimerInput) GetName() string

func (*UpdatableTimerInput) ProtoMessage

func (*UpdatableTimerInput) ProtoMessage()

func (*UpdatableTimerInput) ProtoReflect

func (x *UpdatableTimerInput) ProtoReflect() protoreflect.Message

func (*UpdatableTimerInput) Reset

func (x *UpdatableTimerInput) Reset()

func (*UpdatableTimerInput) String

func (x *UpdatableTimerInput) String() string

type UpdatableTimerOptions

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

UpdatableTimerOptions provides configuration for a UpdatableTimer workflow operation

func NewUpdatableTimerOptions

func NewUpdatableTimerOptions() *UpdatableTimerOptions

NewUpdatableTimerOptions initializes a new UpdatableTimerOptions value

func (*UpdatableTimerOptions) Build added in v1.13.0

Build initializes a new go.temporal.io/sdk/client.StartWorkflowOptions value with defaults and overrides applied

func (*UpdatableTimerOptions) WithExecutionTimeout added in v1.13.0

func (o *UpdatableTimerOptions) WithExecutionTimeout(d time.Duration) *UpdatableTimerOptions

WithExecutionTimeout sets the WorkflowExecutionTimeout value

func (*UpdatableTimerOptions) WithID added in v1.13.0

WithID sets the ID value

func (*UpdatableTimerOptions) WithIDReusePolicy added in v1.13.0

WithIDReusePolicy sets the WorkflowIDReusePolicy value

func (*UpdatableTimerOptions) WithRetryPolicy added in v1.13.0

func (o *UpdatableTimerOptions) WithRetryPolicy(policy *temporal.RetryPolicy) *UpdatableTimerOptions

WithRetryPolicy sets the RetryPolicy value

func (*UpdatableTimerOptions) WithRunTimeout added in v1.13.0

WithRunTimeout sets the WorkflowRunTimeout value

func (*UpdatableTimerOptions) WithSearchAttributes added in v1.13.0

func (o *UpdatableTimerOptions) WithSearchAttributes(sa map[string]any) *UpdatableTimerOptions

WithSearchAttributes sets the SearchAttributes value

func (*UpdatableTimerOptions) WithStartWorkflowOptions

func (o *UpdatableTimerOptions) WithStartWorkflowOptions(options client.StartWorkflowOptions) *UpdatableTimerOptions

WithStartWorkflowOptions sets the initial go.temporal.io/sdk/client.StartWorkflowOptions

func (*UpdatableTimerOptions) WithTaskQueue added in v1.13.0

func (o *UpdatableTimerOptions) WithTaskQueue(tq string) *UpdatableTimerOptions

WithTaskQueue sets the TaskQueue value

func (*UpdatableTimerOptions) WithTaskTimeout added in v1.13.0

WithTaskTimeout sets the WorkflowTaskTimeout value

type UpdatableTimerRun

type UpdatableTimerRun interface {
	// ID returns the workflow ID
	ID() string

	// RunID returns the workflow instance ID
	RunID() string

	// Run returns the inner client.WorkflowRun
	Run() client.WorkflowRun

	// Get blocks until the workflow is complete and returns the result
	Get(ctx context.Context) error

	// Cancel requests cancellation of a workflow in execution, returning an error if applicable
	Cancel(ctx context.Context) error

	// Terminate terminates a workflow in execution, returning an error if applicable
	Terminate(ctx context.Context, reason string, details ...interface{}) error

	// GetWakeUpTime retrieves the current timer expiration timestamp
	GetWakeUpTime(ctx context.Context) (*GetWakeUpTimeOutput, error)

	// UpdateWakeUpTime updates the timer expiration timestamp
	UpdateWakeUpTime(ctx context.Context, req *UpdateWakeUpTimeInput) error
}

UpdatableTimerRun describes a(n) UpdatableTimer workflow run

type UpdatableTimerWorkflow

type UpdatableTimerWorkflow interface {
	// Execute defines the entrypoint to a(n) UpdatableTimer workflow
	Execute(ctx workflow.Context) error

	// GetWakeUpTime retrieves the current timer expiration timestamp
	GetWakeUpTime() (*GetWakeUpTimeOutput, error)
}

UpdatableTimer describes an updatable timer workflow

workflow details: (id: "updatable-timer/${! name.or(uuid_v4()) }")

type UpdatableTimerWorkflowInput

type UpdatableTimerWorkflowInput struct {
	Req              *UpdatableTimerInput
	UpdateWakeUpTime *UpdateWakeUpTimeSignal
}

UpdatableTimerWorkflowInput describes the input to a(n) UpdatableTimer workflow constructor

type UpdateWakeUpTimeInput

type UpdateWakeUpTimeInput struct {
	WakeUpTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=wake_up_time,json=wakeUpTime,proto3" json:"wake_up_time,omitempty"`
	// contains filtered or unexported fields
}

UpdateWakeUpTimeInput describes the input to a UpdateWakeUpTime signal

func UnmarshalCliFlagsToUpdateWakeUpTimeInput

func UnmarshalCliFlagsToUpdateWakeUpTimeInput(cmd *v2.Context) (*UpdateWakeUpTimeInput, error)

UnmarshalCliFlagsToUpdateWakeUpTimeInput unmarshals a UpdateWakeUpTimeInput from command line flags

func (*UpdateWakeUpTimeInput) Descriptor deprecated

func (*UpdateWakeUpTimeInput) Descriptor() ([]byte, []int)

Deprecated: Use UpdateWakeUpTimeInput.ProtoReflect.Descriptor instead.

func (*UpdateWakeUpTimeInput) GetWakeUpTime

func (x *UpdateWakeUpTimeInput) GetWakeUpTime() *timestamppb.Timestamp

func (*UpdateWakeUpTimeInput) ProtoMessage

func (*UpdateWakeUpTimeInput) ProtoMessage()

func (*UpdateWakeUpTimeInput) ProtoReflect

func (x *UpdateWakeUpTimeInput) ProtoReflect() protoreflect.Message

func (*UpdateWakeUpTimeInput) Reset

func (x *UpdateWakeUpTimeInput) Reset()

func (*UpdateWakeUpTimeInput) String

func (x *UpdateWakeUpTimeInput) String() string

type UpdateWakeUpTimeSignal

type UpdateWakeUpTimeSignal struct {
	Channel workflow.ReceiveChannel
}

UpdateWakeUpTimeSignal describes a(n) example.updatabletimer.v1.Example.UpdateWakeUpTime signal

func NewUpdateWakeUpTimeSignal

func NewUpdateWakeUpTimeSignal(ctx workflow.Context) *UpdateWakeUpTimeSignal

NewUpdateWakeUpTimeSignal initializes a new example.updatabletimer.v1.Example.UpdateWakeUpTime signal wrapper

func (*UpdateWakeUpTimeSignal) Receive

Receive blocks until a(n) example.updatabletimer.v1.Example.UpdateWakeUpTime signal is received

func (*UpdateWakeUpTimeSignal) ReceiveAsync

func (s *UpdateWakeUpTimeSignal) ReceiveAsync() *UpdateWakeUpTimeInput

ReceiveAsync checks for a example.updatabletimer.v1.Example.UpdateWakeUpTime signal without blocking

func (*UpdateWakeUpTimeSignal) ReceiveWithTimeout

func (s *UpdateWakeUpTimeSignal) ReceiveWithTimeout(ctx workflow.Context, timeout time.Duration) (resp *UpdateWakeUpTimeInput, ok bool, more bool)

ReceiveWithTimeout blocks until a(n) example.updatabletimer.v1.Example.UpdateWakeUpTime signal is received or timeout expires. Returns more value of false when Channel is closed. Returns ok value of false when no value was found in the channel for the duration of timeout or the ctx was canceled. resp will be nil if ok is false.

func (*UpdateWakeUpTimeSignal) Select

Select checks for a(n) example.updatabletimer.v1.Example.UpdateWakeUpTime signal without blocking

Directories

Path Synopsis
Code generated by protoc-gen-go_temporal.
Code generated by protoc-gen-go_temporal.

Jump to

Keyboard shortcuts

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