helloworldv1

package
v1.14.3 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

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

protoc-gen-go_temporal 1.14.3-next (974fdc3d78b6359d0e967899ac581d33b6a0bc71)
go go1.22.2
protoc (unknown)

source: example/helloworld/v1/example.proto

Index

Constants

View Source
const ExampleTaskQueue = "hello-world"

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

View Source
const (
	GoodbyeSignalName = "example.helloworld.v1.Example.Goodbye"
)

example.helloworld.v1.Example signal names

View Source
const (
	HelloWorkflowName = "example.v1.Hello"
)

example.helloworld.v1.Example workflow names

Variables

View Source
var File_example_helloworld_v1_example_proto protoreflect.FileDescriptor
View Source
var (
	// Hello prints a friendly greeting and waits for goodbye
	HelloFunction func(workflow.Context, *HelloRequest) (*HelloResponse, error)
)

Reference to generated workflow functions

View Source
var (
	HelloIdexpression = expression.MustParseExpression("hello/${! name.or(\"World\") }")
)

example.helloworld.v1.Example workflow id expressions

Functions

func GoodbyeExternal added in v1.12.0

func GoodbyeExternal(ctx workflow.Context, workflowID string, runID string, req *GoodbyeRequest) error

Goodbye signals a running workflow to exit

func GoodbyeExternalAsync added in v1.12.0

func GoodbyeExternalAsync(ctx workflow.Context, workflowID string, runID string, req *GoodbyeRequest) workflow.Future

Goodbye signals a running workflow to exit

func NewExampleCli added in v1.12.0

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

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

func NewExampleCliCommand added in v1.12.0

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

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

func NewExampleClientOptions added in v1.12.0

func NewExampleClientOptions() *exampleClientOptions

NewExampleClientOptions initializes a new exampleClientOptions value

func RegisterExampleActivities added in v1.12.0

func RegisterExampleActivities(r worker.ActivityRegistry, activities ExampleActivities)

RegisterExampleActivities registers activities with a worker

func RegisterExampleWorkflows added in v1.12.0

func RegisterExampleWorkflows(r worker.WorkflowRegistry, workflows ExampleWorkflows)

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

func RegisterHelloWorkflow added in v1.12.0

func RegisterHelloWorkflow(r worker.WorkflowRegistry, wf func(workflow.Context, *HelloWorkflowInput) (HelloWorkflow, error))

RegisterHelloWorkflow registers a example.helloworld.v1.Example.Hello workflow with the given worker

func WithExampleSchemeTypes added in v1.12.0

func WithExampleSchemeTypes() scheme.Option

WithExampleSchemeTypes registers all Example protobuf types with the given scheme

Types

type ExampleActivities added in v1.12.0

type ExampleActivities interface{}

ExampleActivities describes available worker activities

type ExampleCliOptions added in v1.12.0

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

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

func NewExampleCliOptions added in v1.12.0

func NewExampleCliOptions() *ExampleCliOptions

NewExampleCliOptions initializes a new ExampleCliOptions value

func (*ExampleCliOptions) WithAfter added in v1.12.0

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 added in v1.12.0

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 added in v1.12.0

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 added in v1.12.0

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

WithWorker provides an method for initializing a worker

type ExampleClient added in v1.12.0

type ExampleClient interface {
	// Hello prints a friendly greeting and waits for goodbye
	Hello(ctx context.Context, req *HelloRequest, opts ...*HelloOptions) (*HelloResponse, error)

	// HelloAsync starts a(n) example.v1.Hello workflow and returns a handle to the workflow run
	HelloAsync(ctx context.Context, req *HelloRequest, opts ...*HelloOptions) (HelloRun, error)

	// GetHello retrieves a handle to an existing example.v1.Hello workflow execution
	GetHello(ctx context.Context, workflowID string, runID string) HelloRun

	// 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

	// Goodbye signals a running workflow to exit
	Goodbye(ctx context.Context, workflowID string, runID string, signal *GoodbyeRequest) error
}

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

func NewExampleClient added in v1.12.0

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

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

func NewExampleClientWithOptions added in v1.12.0

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 {
	// Hello prints a friendly greeting and waits for goodbye
	Hello(workflow.Context, *HelloRequest) (*HelloResponse, error)
}

ExampleWorkflowFunctions describes a mockable dependency for inlining workflows within other workflows

func NewExampleWorkflowFunctions added in v1.12.0

func NewExampleWorkflowFunctions() ExampleWorkflowFunctions

type ExampleWorkflows added in v1.12.0

type ExampleWorkflows interface {
	// Hello prints a friendly greeting and waits for goodbye
	Hello(ctx workflow.Context, input *HelloWorkflowInput) (HelloWorkflow, error)
}

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

type GoodbyeRequest added in v1.12.0

type GoodbyeRequest struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func UnmarshalCliFlagsToGoodbyeRequest added in v1.12.0

func UnmarshalCliFlagsToGoodbyeRequest(cmd *v2.Context) (*GoodbyeRequest, error)

UnmarshalCliFlagsToGoodbyeRequest unmarshals a GoodbyeRequest from command line flags

func (*GoodbyeRequest) Descriptor deprecated added in v1.12.0

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

Deprecated: Use GoodbyeRequest.ProtoReflect.Descriptor instead.

func (*GoodbyeRequest) GetMessage added in v1.12.0

func (x *GoodbyeRequest) GetMessage() string

func (*GoodbyeRequest) ProtoMessage added in v1.12.0

func (*GoodbyeRequest) ProtoMessage()

func (*GoodbyeRequest) ProtoReflect added in v1.12.0

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

func (*GoodbyeRequest) Reset added in v1.12.0

func (x *GoodbyeRequest) Reset()

func (*GoodbyeRequest) String added in v1.12.0

func (x *GoodbyeRequest) String() string

type GoodbyeSignal added in v1.12.0

type GoodbyeSignal struct {
	Channel workflow.ReceiveChannel
}

GoodbyeSignal describes a(n) example.helloworld.v1.Example.Goodbye signal

func NewGoodbyeSignal added in v1.12.0

func NewGoodbyeSignal(ctx workflow.Context) *GoodbyeSignal

NewGoodbyeSignal initializes a new example.helloworld.v1.Example.Goodbye signal wrapper

func (*GoodbyeSignal) Receive added in v1.12.0

func (s *GoodbyeSignal) Receive(ctx workflow.Context) (*GoodbyeRequest, bool)

Receive blocks until a(n) example.helloworld.v1.Example.Goodbye signal is received

func (*GoodbyeSignal) ReceiveAsync added in v1.12.0

func (s *GoodbyeSignal) ReceiveAsync() *GoodbyeRequest

ReceiveAsync checks for a example.helloworld.v1.Example.Goodbye signal without blocking

func (*GoodbyeSignal) ReceiveWithTimeout added in v1.12.0

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

ReceiveWithTimeout blocks until a(n) example.helloworld.v1.Example.Goodbye 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 (*GoodbyeSignal) Select added in v1.12.0

func (s *GoodbyeSignal) Select(sel workflow.Selector, fn func(*GoodbyeRequest)) workflow.Selector

Select checks for a(n) example.helloworld.v1.Example.Goodbye signal without blocking

type HelloChildOptions added in v1.12.0

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

HelloChildOptions provides configuration for a child example.v1.Hello workflow operation

func NewHelloChildOptions added in v1.12.0

func NewHelloChildOptions() *HelloChildOptions

NewHelloChildOptions initializes a new HelloChildOptions value

func (*HelloChildOptions) Build added in v1.13.0

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

func (*HelloChildOptions) WithChildWorkflowOptions added in v1.12.0

func (o *HelloChildOptions) WithChildWorkflowOptions(options workflow.ChildWorkflowOptions) *HelloChildOptions

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

func (*HelloChildOptions) WithExecutionTimeout added in v1.13.0

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

WithExecutionTimeout sets the WorkflowExecutionTimeout value

func (*HelloChildOptions) WithID added in v1.13.0

WithID sets the WorkflowID value

func (*HelloChildOptions) WithIDReusePolicy added in v1.13.0

func (o *HelloChildOptions) WithIDReusePolicy(policy enumsv1.WorkflowIdReusePolicy) *HelloChildOptions

WithIDReusePolicy sets the WorkflowIDReusePolicy value

func (*HelloChildOptions) WithParentClosePolicy added in v1.13.0

func (o *HelloChildOptions) WithParentClosePolicy(policy enumsv1.ParentClosePolicy) *HelloChildOptions

WithParentClosePolicy sets the WorkflowIDReusePolicy value

func (*HelloChildOptions) WithRetryPolicy added in v1.13.0

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

WithRetryPolicy sets the RetryPolicy value

func (*HelloChildOptions) WithRunTimeout added in v1.13.0

func (o *HelloChildOptions) WithRunTimeout(d time.Duration) *HelloChildOptions

WithRunTimeout sets the WorkflowRunTimeout value

func (*HelloChildOptions) WithSearchAttributes added in v1.13.0

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

WithSearchAttributes sets the SearchAttributes value

func (*HelloChildOptions) WithTaskQueue added in v1.13.0

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

WithTaskQueue sets the TaskQueue value

func (*HelloChildOptions) WithTaskTimeout added in v1.13.0

func (o *HelloChildOptions) WithTaskTimeout(d time.Duration) *HelloChildOptions

WithTaskTimeout sets the WorkflowTaskTimeout value

func (*HelloChildOptions) WithWaitForCancellation added in v1.13.0

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

WithWaitForCancellation sets the WaitForCancellation value

type HelloChildRun added in v1.12.0

type HelloChildRun struct {
	Future workflow.ChildWorkflowFuture
}

HelloChildRun describes a child Hello workflow run

func HelloChildAsync added in v1.12.0

func HelloChildAsync(ctx workflow.Context, req *HelloRequest, options ...*HelloChildOptions) (*HelloChildRun, error)

Hello prints a friendly greeting and waits for goodbye

func (*HelloChildRun) Get added in v1.12.0

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

func (*HelloChildRun) Goodbye added in v1.12.0

func (r *HelloChildRun) Goodbye(ctx workflow.Context, input *GoodbyeRequest) error

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

func (*HelloChildRun) GoodbyeAsync added in v1.12.0

func (r *HelloChildRun) GoodbyeAsync(ctx workflow.Context, input *GoodbyeRequest) workflow.Future

GoodbyeAsync sends a(n) "example.helloworld.v1.Example.Goodbye" signal request to the child workflow

func (*HelloChildRun) Select added in v1.12.0

func (r *HelloChildRun) Select(sel workflow.Selector, fn func(*HelloChildRun)) workflow.Selector

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

func (*HelloChildRun) SelectStart added in v1.12.0

func (r *HelloChildRun) SelectStart(sel workflow.Selector, fn func(*HelloChildRun)) workflow.Selector

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

func (*HelloChildRun) WaitStart added in v1.12.0

func (r *HelloChildRun) WaitStart(ctx workflow.Context) (*workflow.Execution, error)

WaitStart waits for the child workflow to start

type HelloOptions added in v1.12.0

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

HelloOptions provides configuration for a example.v1.Hello workflow operation

func NewHelloOptions added in v1.12.0

func NewHelloOptions() *HelloOptions

NewHelloOptions initializes a new HelloOptions value

func (*HelloOptions) Build added in v1.13.0

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

func (*HelloOptions) WithExecutionTimeout added in v1.13.0

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

WithExecutionTimeout sets the WorkflowExecutionTimeout value

func (*HelloOptions) WithID added in v1.13.0

func (o *HelloOptions) WithID(id string) *HelloOptions

WithID sets the ID value

func (*HelloOptions) WithIDReusePolicy added in v1.13.0

func (o *HelloOptions) WithIDReusePolicy(policy enumsv1.WorkflowIdReusePolicy) *HelloOptions

WithIDReusePolicy sets the WorkflowIDReusePolicy value

func (*HelloOptions) WithRetryPolicy added in v1.13.0

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

WithRetryPolicy sets the RetryPolicy value

func (*HelloOptions) WithRunTimeout added in v1.13.0

func (o *HelloOptions) WithRunTimeout(d time.Duration) *HelloOptions

WithRunTimeout sets the WorkflowRunTimeout value

func (*HelloOptions) WithSearchAttributes added in v1.13.0

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

WithSearchAttributes sets the SearchAttributes value

func (*HelloOptions) WithStartWorkflowOptions added in v1.12.0

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

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

func (*HelloOptions) WithTaskQueue added in v1.13.0

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

WithTaskQueue sets the TaskQueue value

func (*HelloOptions) WithTaskTimeout added in v1.13.0

func (o *HelloOptions) WithTaskTimeout(d time.Duration) *HelloOptions

WithTaskTimeout sets the WorkflowTaskTimeout value

type HelloRequest added in v1.12.0

type HelloRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

HelloRequest describes the input to a Hello workflow

func UnmarshalCliFlagsToHelloRequest added in v1.12.0

func UnmarshalCliFlagsToHelloRequest(cmd *v2.Context) (*HelloRequest, error)

UnmarshalCliFlagsToHelloRequest unmarshals a HelloRequest from command line flags

func (*HelloRequest) Descriptor deprecated added in v1.12.0

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

Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.

func (*HelloRequest) GetName added in v1.12.0

func (x *HelloRequest) GetName() string

func (*HelloRequest) ProtoMessage added in v1.12.0

func (*HelloRequest) ProtoMessage()

func (*HelloRequest) ProtoReflect added in v1.12.0

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

func (*HelloRequest) Reset added in v1.12.0

func (x *HelloRequest) Reset()

func (*HelloRequest) String added in v1.12.0

func (x *HelloRequest) String() string

type HelloResponse added in v1.12.0

type HelloResponse struct {
	Result string `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

HelloResponse describes the output from a Hello workflow

func HelloChild added in v1.12.0

func HelloChild(ctx workflow.Context, req *HelloRequest, options ...*HelloChildOptions) (*HelloResponse, error)

Hello prints a friendly greeting and waits for goodbye

func (*HelloResponse) Descriptor deprecated added in v1.12.0

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

Deprecated: Use HelloResponse.ProtoReflect.Descriptor instead.

func (*HelloResponse) GetResult added in v1.12.0

func (x *HelloResponse) GetResult() string

func (*HelloResponse) ProtoMessage added in v1.12.0

func (*HelloResponse) ProtoMessage()

func (*HelloResponse) ProtoReflect added in v1.12.0

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

func (*HelloResponse) Reset added in v1.12.0

func (x *HelloResponse) Reset()

func (*HelloResponse) String added in v1.12.0

func (x *HelloResponse) String() string

type HelloRun added in v1.12.0

type HelloRun 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) (*HelloResponse, 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

	// Goodbye signals a running workflow to exit
	Goodbye(ctx context.Context, req *GoodbyeRequest) error
}

HelloRun describes a(n) example.v1.Hello workflow run

type HelloWorkflow added in v1.12.0

type HelloWorkflow interface {
	// Execute defines the entrypoint to a(n) example.v1.Hello workflow
	Execute(ctx workflow.Context) (*HelloResponse, error)
}

Hello prints a friendly greeting and waits for goodbye

workflow details: (name: "example.v1.Hello", id: "hello/${! name.or("World") }")

type HelloWorkflowInput added in v1.12.0

type HelloWorkflowInput struct {
	Req     *HelloRequest
	Goodbye *GoodbyeSignal
}

HelloWorkflowInput describes the input to a(n) example.v1.Hello workflow constructor

type TestExampleClient added in v1.12.0

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

TestClient provides a testsuite-compatible Client

func NewTestExampleClient added in v1.12.0

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

NewTestExampleClient initializes a new TestExampleClient value

func (*TestExampleClient) CancelWorkflow added in v1.12.0

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

CancelWorkflow requests cancellation of an existing workflow execution

func (*TestExampleClient) GetHello added in v1.12.0

func (c *TestExampleClient) GetHello(ctx context.Context, workflowID string, runID string) HelloRun

GetHello is a noop

func (*TestExampleClient) Goodbye added in v1.12.0

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

Goodbye executes a example.helloworld.v1.Example.Goodbye signal

func (*TestExampleClient) Hello added in v1.12.0

func (c *TestExampleClient) Hello(ctx context.Context, req *HelloRequest, opts ...*HelloOptions) (*HelloResponse, error)

Hello executes a(n) example.v1.Hello workflow in the test environment

func (*TestExampleClient) HelloAsync added in v1.12.0

func (c *TestExampleClient) HelloAsync(ctx context.Context, req *HelloRequest, options ...*HelloOptions) (HelloRun, error)

HelloAsync executes a(n) example.v1.Hello workflow in the test environment

func (*TestExampleClient) TerminateWorkflow added in v1.12.0

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

TerminateWorkflow terminates an existing workflow execution

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