schedulev1

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: 26 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/schedule/v1/schedule.proto

Index

Constants

View Source
const ExampleTaskQueue = "schedule-v1"

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

View Source
const (
	ScheduleWorkflowName = "example.schedule.v1.Schedule"
)

example.schedule.v1.Example workflow names

Variables

View Source
var File_example_schedule_v1_schedule_proto protoreflect.FileDescriptor
View Source
var (
	// ScheduleFunction implements a "example.schedule.v1.Schedule" workflow
	ScheduleFunction func(workflow.Context, *ScheduleInput) (*ScheduleOutput, error)
)

Reference to generated workflow functions

Functions

func NewExampleCli

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

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

func NewExampleCliCommand

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

NewExampleCliCommand initializes a cli command for a example.schedule.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.schedule.v1.Example workflows with the given worker

func RegisterScheduleWorkflow

func RegisterScheduleWorkflow(r worker.WorkflowRegistry, wf func(workflow.Context, *ScheduleWorkflowInput) (ScheduleWorkflow, error))

RegisterScheduleWorkflow registers a example.schedule.v1.Example.Schedule workflow with the given worker

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.schedule.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 {
	// Schedule executes a(n) example.schedule.v1.Schedule workflow and blocks until error or response received
	Schedule(ctx context.Context, req *ScheduleInput, opts ...*ScheduleOptions) (*ScheduleOutput, error)

	// ScheduleAsync starts a(n) example.schedule.v1.Schedule workflow and returns a handle to the workflow run
	ScheduleAsync(ctx context.Context, req *ScheduleInput, opts ...*ScheduleOptions) (ScheduleRun, error)

	// GetSchedule retrieves a handle to an existing example.schedule.v1.Schedule workflow execution
	GetSchedule(ctx context.Context, workflowID string, runID string) ScheduleRun

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

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

func NewExampleClient

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

NewExampleClient initializes a new example.schedule.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

type ExampleWorkflowFunctions interface {
	// Schedule executes a "example.schedule.v1.Schedule" workflow inline
	Schedule(workflow.Context, *ScheduleInput) (*ScheduleOutput, error)
}

ExampleWorkflowFunctions describes a mockable dependency for inlining workflows within other workflows

func NewExampleWorkflowFunctions

func NewExampleWorkflowFunctions() ExampleWorkflowFunctions

type ExampleWorkflows

type ExampleWorkflows interface {
	// Schedule initializes a new a(n) ScheduleWorkflow implementation
	Schedule(ctx workflow.Context, input *ScheduleWorkflowInput) (ScheduleWorkflow, error)
}

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

type ScheduleChildOptions

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

ScheduleChildOptions provides configuration for a child example.schedule.v1.Schedule workflow operation

func NewScheduleChildOptions

func NewScheduleChildOptions() *ScheduleChildOptions

NewScheduleChildOptions initializes a new ScheduleChildOptions value

func (*ScheduleChildOptions) Build

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

func (*ScheduleChildOptions) WithChildWorkflowOptions

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

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

func (*ScheduleChildOptions) WithExecutionTimeout

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

WithExecutionTimeout sets the WorkflowExecutionTimeout value

func (*ScheduleChildOptions) WithID

WithID sets the WorkflowID value

func (*ScheduleChildOptions) WithIDReusePolicy

WithIDReusePolicy sets the WorkflowIDReusePolicy value

func (*ScheduleChildOptions) WithParentClosePolicy

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

WithParentClosePolicy sets the WorkflowIDReusePolicy value

func (*ScheduleChildOptions) WithRetryPolicy

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

WithRetryPolicy sets the RetryPolicy value

func (*ScheduleChildOptions) WithRunTimeout

WithRunTimeout sets the WorkflowRunTimeout value

func (*ScheduleChildOptions) WithSearchAttributes

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

WithSearchAttributes sets the SearchAttributes value

func (*ScheduleChildOptions) WithTaskQueue

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

WithTaskQueue sets the TaskQueue value

func (*ScheduleChildOptions) WithTaskTimeout

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

WithTaskTimeout sets the WorkflowTaskTimeout value

func (*ScheduleChildOptions) WithWaitForCancellation

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

WithWaitForCancellation sets the WaitForCancellation value

type ScheduleChildRun

type ScheduleChildRun struct {
	Future workflow.ChildWorkflowFuture
}

ScheduleChildRun describes a child Schedule workflow run

func ScheduleChildAsync

func ScheduleChildAsync(ctx workflow.Context, req *ScheduleInput, options ...*ScheduleChildOptions) (*ScheduleChildRun, error)

ScheduleChildAsync starts a child example.schedule.v1.Schedule workflow and returns a handle to the child workflow run

func (*ScheduleChildRun) Get

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

func (*ScheduleChildRun) Select

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

func (*ScheduleChildRun) SelectStart

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

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

func (*ScheduleChildRun) WaitStart

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

WaitStart waits for the child workflow to start

type ScheduleInput

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

func UnmarshalCliFlagsToScheduleInput

func UnmarshalCliFlagsToScheduleInput(cmd *v2.Context) (*ScheduleInput, error)

UnmarshalCliFlagsToScheduleInput unmarshals a ScheduleInput from command line flags

func (*ScheduleInput) Descriptor deprecated

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

Deprecated: Use ScheduleInput.ProtoReflect.Descriptor instead.

func (*ScheduleInput) ProtoMessage

func (*ScheduleInput) ProtoMessage()

func (*ScheduleInput) ProtoReflect

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

func (*ScheduleInput) Reset

func (x *ScheduleInput) Reset()

func (*ScheduleInput) String

func (x *ScheduleInput) String() string

type ScheduleOptions

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

ScheduleOptions provides configuration for a example.schedule.v1.Schedule workflow operation

func NewScheduleOptions

func NewScheduleOptions() *ScheduleOptions

NewScheduleOptions initializes a new ScheduleOptions value

func (*ScheduleOptions) Build

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

func (*ScheduleOptions) WithExecutionTimeout

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

WithExecutionTimeout sets the WorkflowExecutionTimeout value

func (*ScheduleOptions) WithID

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

WithID sets the ID value

func (*ScheduleOptions) WithIDReusePolicy

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

WithIDReusePolicy sets the WorkflowIDReusePolicy value

func (*ScheduleOptions) WithRetryPolicy

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

WithRetryPolicy sets the RetryPolicy value

func (*ScheduleOptions) WithRunTimeout

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

WithRunTimeout sets the WorkflowRunTimeout value

func (*ScheduleOptions) WithSearchAttributes

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

WithSearchAttributes sets the SearchAttributes value

func (*ScheduleOptions) WithStartWorkflowOptions

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

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

func (*ScheduleOptions) WithTaskQueue

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

WithTaskQueue sets the TaskQueue value

func (*ScheduleOptions) WithTaskTimeout

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

WithTaskTimeout sets the WorkflowTaskTimeout value

type ScheduleOutput

type ScheduleOutput struct {
	StartedAt *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=started_at,json=startedAt,proto3" json:"started_at,omitempty"`
	// contains filtered or unexported fields
}

func ScheduleChild

func ScheduleChild(ctx workflow.Context, req *ScheduleInput, options ...*ScheduleChildOptions) (*ScheduleOutput, error)

ScheduleChild executes a child example.schedule.v1.Schedule workflow and blocks until error or response received

func (*ScheduleOutput) Descriptor deprecated

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

Deprecated: Use ScheduleOutput.ProtoReflect.Descriptor instead.

func (*ScheduleOutput) GetStartedAt

func (x *ScheduleOutput) GetStartedAt() *timestamppb.Timestamp

func (*ScheduleOutput) ProtoMessage

func (*ScheduleOutput) ProtoMessage()

func (*ScheduleOutput) ProtoReflect

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

func (*ScheduleOutput) Reset

func (x *ScheduleOutput) Reset()

func (*ScheduleOutput) String

func (x *ScheduleOutput) String() string

type ScheduleRun

type ScheduleRun 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) (*ScheduleOutput, 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
}

ScheduleRun describes a(n) example.schedule.v1.Schedule workflow run

type ScheduleWorkflow

type ScheduleWorkflow interface {
	// Execute defines the entrypoint to a(n) example.schedule.v1.Schedule workflow
	Execute(ctx workflow.Context) (*ScheduleOutput, error)
}

ScheduleWorkflow describes a(n) example.schedule.v1.Schedule workflow implementation

type ScheduleWorkflowInput

type ScheduleWorkflowInput struct {
	Req *ScheduleInput
}

ScheduleWorkflowInput describes the input to a(n) example.schedule.v1.Schedule workflow constructor

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) GetSchedule

func (c *TestExampleClient) GetSchedule(ctx context.Context, workflowID string, runID string) ScheduleRun

GetSchedule is a noop

func (*TestExampleClient) Schedule

func (c *TestExampleClient) Schedule(ctx context.Context, req *ScheduleInput, opts ...*ScheduleOptions) (*ScheduleOutput, error)

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

func (*TestExampleClient) ScheduleAsync

func (c *TestExampleClient) ScheduleAsync(ctx context.Context, req *ScheduleInput, options ...*ScheduleOptions) (ScheduleRun, error)

ScheduleAsync executes a(n) example.schedule.v1.Schedule workflow in the test environment

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

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