mutexv1

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 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.11.1-next (c39ba7f5af358428c18ecce12978be63d88f77f4)
go go1.22.1
protoc (unknown)

source: example/mutex/v1/mutex.proto

Index

Constants

View Source
const (
	MutexWorkflowName                   = "example.mutex.v1.Example.Mutex"
	SampleWorkflowWithMutexWorkflowName = "example.mutex.v1.Example.SampleWorkflowWithMutex"
)

example.mutex.v1.Example workflow names

View Source
const (
	AcquireLockSignalName  = "example.mutex.v1.Example.AcquireLock"
	LockAcquiredSignalName = "example.mutex.v1.Example.LockAcquired"
	ReleaseLockSignalName  = "example.mutex.v1.Example.ReleaseLock"
)

example.mutex.v1.Example signal names

View Source
const ExampleTaskQueue = "mutex"

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

View Source
const (
	MutexActivityName = "example.mutex.v1.Example.Mutex"
)

example.mutex.v1.Example activity names

Variables

View Source
var (
	MutexIdexpression                   = expression.MustParseExpression("mutex:${! resourceId }")
	SampleWorkflowWithMutexIdexpression = expression.MustParseExpression("SampleWorkflow1WithMutex_${! uuid_v4() }")
)

example.mutex.v1.Example workflow id expressions

View Source
var (
	// MutexFunction implements a "example.mutex.v1.Example.Mutex" workflow
	MutexFunction func(workflow.Context, *MutexInput) error
	// SampleWorkflowWithMutexFunction implements a "example.mutex.v1.Example.SampleWorkflowWithMutex" workflow
	SampleWorkflowWithMutexFunction func(workflow.Context, *SampleWorkflowWithMutexInput) error
)

Reference to generated workflow functions

View Source
var File_example_mutex_v1_mutex_proto protoreflect.FileDescriptor

Functions

func AcquireLockExternal

func AcquireLockExternal(ctx workflow.Context, workflowID string, runID string, req *AcquireLockInput) error

AcquireLockExternal sends a(n) example.mutex.v1.Example.AcquireLock signal to an existing workflow

func AcquireLockExternalAsync

func AcquireLockExternalAsync(ctx workflow.Context, workflowID string, runID string, req *AcquireLockInput) workflow.Future

AcquireLockExternalAsync sends a(n) example.mutex.v1.Example.AcquireLock signal to an existing workflow

func LockAcquiredExternal

func LockAcquiredExternal(ctx workflow.Context, workflowID string, runID string, req *LockAcquiredInput) error

LockAcquiredExternal sends a(n) example.mutex.v1.Example.LockAcquired signal to an existing workflow

func LockAcquiredExternalAsync

func LockAcquiredExternalAsync(ctx workflow.Context, workflowID string, runID string, req *LockAcquiredInput) workflow.Future

LockAcquiredExternalAsync sends a(n) example.mutex.v1.Example.LockAcquired signal to an existing workflow

func Mutex

func Mutex(ctx workflow.Context, req *MutexInput, options ...*MutexActivityOptions) error

Mutex executes a(n) example.mutex.v1.Example.Mutex activity

func MutexChild

func MutexChild(ctx workflow.Context, req *MutexInput, options ...*MutexChildOptions) error

MutexChild executes a child example.mutex.v1.Example.Mutex workflow and blocks until error or response received

func MutexLocal

func MutexLocal(ctx workflow.Context, req *MutexInput, options ...*MutexLocalActivityOptions) error

MutexLocal executes a(n) example.mutex.v1.Example.Mutex activity (locally)

func NewExampleCli

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

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

func NewExampleCliCommand

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

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

func RegisterMutexActivity

func RegisterMutexActivity(r worker.ActivityRegistry, fn func(context.Context, *MutexInput) error)

RegisterMutexActivity registers a example.mutex.v1.Example.Mutex activity

func RegisterMutexWorkflow

func RegisterMutexWorkflow(r worker.WorkflowRegistry, wf func(workflow.Context, *MutexWorkflowInput) (MutexWorkflow, error))

RegisterMutexWorkflow registers a example.mutex.v1.Example.Mutex workflow with the given worker

func RegisterSampleWorkflowWithMutexWorkflow

RegisterSampleWorkflowWithMutexWorkflow registers a example.mutex.v1.Example.SampleWorkflowWithMutex workflow with the given worker

func ReleaseLockExternal

func ReleaseLockExternal(ctx workflow.Context, workflowID string, runID string, req *ReleaseLockInput) error

ReleaseLockExternal sends a(n) example.mutex.v1.Example.ReleaseLock signal to an existing workflow

func ReleaseLockExternalAsync

func ReleaseLockExternalAsync(ctx workflow.Context, workflowID string, runID string, req *ReleaseLockInput) workflow.Future

ReleaseLockExternalAsync sends a(n) example.mutex.v1.Example.ReleaseLock signal to an existing workflow

func SampleWorkflowWithMutexChild

func SampleWorkflowWithMutexChild(ctx workflow.Context, req *SampleWorkflowWithMutexInput, options ...*SampleWorkflowWithMutexChildOptions) error

SampleWorkflowWithMutexChild executes a child example.mutex.v1.Example.SampleWorkflowWithMutex workflow and blocks until error or response received

func WithExampleSchemeTypes

func WithExampleSchemeTypes() scheme.Option

WithExampleSchemeTypes registers all Example protobuf types with the given scheme

Types

type AcquireLockInput

type AcquireLockInput struct {
	WorkflowId string               `protobuf:"bytes,1,opt,name=workflow_id,json=workflowId,proto3" json:"workflow_id,omitempty"`
	Timeout    *durationpb.Duration `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"`
	// contains filtered or unexported fields
}

func UnmarshalCliFlagsToAcquireLockInput

func UnmarshalCliFlagsToAcquireLockInput(cmd *v2.Context) (*AcquireLockInput, error)

UnmarshalCliFlagsToAcquireLockInput unmarshals a AcquireLockInput from command line flags

func (*AcquireLockInput) Descriptor deprecated

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

Deprecated: Use AcquireLockInput.ProtoReflect.Descriptor instead.

func (*AcquireLockInput) GetTimeout

func (x *AcquireLockInput) GetTimeout() *durationpb.Duration

func (*AcquireLockInput) GetWorkflowId

func (x *AcquireLockInput) GetWorkflowId() string

func (*AcquireLockInput) ProtoMessage

func (*AcquireLockInput) ProtoMessage()

func (*AcquireLockInput) ProtoReflect

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

func (*AcquireLockInput) Reset

func (x *AcquireLockInput) Reset()

func (*AcquireLockInput) String

func (x *AcquireLockInput) String() string

type AcquireLockSignal

type AcquireLockSignal struct {
	Channel workflow.ReceiveChannel
}

AcquireLockSignal describes a(n) example.mutex.v1.Example.AcquireLock signal

func NewAcquireLockSignal

func NewAcquireLockSignal(ctx workflow.Context) *AcquireLockSignal

NewAcquireLockSignal initializes a new example.mutex.v1.Example.AcquireLock signal wrapper

func (*AcquireLockSignal) Receive

Receive blocks until a(n) example.mutex.v1.Example.AcquireLock signal is received

func (*AcquireLockSignal) ReceiveAsync

func (s *AcquireLockSignal) ReceiveAsync() *AcquireLockInput

ReceiveAsync checks for a example.mutex.v1.Example.AcquireLock signal without blocking

func (*AcquireLockSignal) ReceiveWithTimeout

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

ReceiveWithTimeout blocks until a(n) example.mutex.v1.Example.AcquireLock 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 (*AcquireLockSignal) Select

Select checks for a(n) example.mutex.v1.Example.AcquireLock signal without blocking

type ExampleActivities

type ExampleActivities interface {
	// example.mutex.v1.Example.Mutex implements a(n) example.mutex.v1.Example.Mutex activity definition
	Mutex(ctx context.Context, req *MutexInput) error
}

ExampleActivities describes available worker activities

type ExampleCliOptions

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

ExampleCliOptions describes runtime configuration for example.mutex.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 {
	// Mutex executes a(n) example.mutex.v1.Example.Mutex workflow and blocks until error or response received
	Mutex(ctx context.Context, req *MutexInput, opts ...*MutexOptions) error

	// MutexAsync starts a(n) example.mutex.v1.Example.Mutex workflow and returns a handle to the workflow run
	MutexAsync(ctx context.Context, req *MutexInput, opts ...*MutexOptions) (MutexRun, error)

	// GetMutex retrieves a handle to an existing example.mutex.v1.Example.Mutex workflow execution
	GetMutex(ctx context.Context, workflowID string, runID string) MutexRun

	// MutexWithAcquireLock sends a(n) example.mutex.v1.Example.AcquireLock signal to a(n) example.mutex.v1.Example.Mutex workflow, starting it if necessary, and blocks until workflow completion
	MutexWithAcquireLock(ctx context.Context, req *MutexInput, signal *AcquireLockInput, opts ...*MutexOptions) error

	// MutexWithAcquireLockAsync sends a(n) example.mutex.v1.Example.AcquireLock signal to a(n) example.mutex.v1.Example.Mutex workflow, starting it if necessary, and returns a handle to the workflow execution
	MutexWithAcquireLockAsync(ctx context.Context, req *MutexInput, signal *AcquireLockInput, opts ...*MutexOptions) (MutexRun, error)

	// SampleWorkflowWithMutex executes a(n) example.mutex.v1.Example.SampleWorkflowWithMutex workflow and blocks until error or response received
	SampleWorkflowWithMutex(ctx context.Context, req *SampleWorkflowWithMutexInput, opts ...*SampleWorkflowWithMutexOptions) error

	// SampleWorkflowWithMutexAsync starts a(n) example.mutex.v1.Example.SampleWorkflowWithMutex workflow and returns a handle to the workflow run
	SampleWorkflowWithMutexAsync(ctx context.Context, req *SampleWorkflowWithMutexInput, opts ...*SampleWorkflowWithMutexOptions) (SampleWorkflowWithMutexRun, error)

	// GetSampleWorkflowWithMutex retrieves a handle to an existing example.mutex.v1.Example.SampleWorkflowWithMutex workflow execution
	GetSampleWorkflowWithMutex(ctx context.Context, workflowID string, runID string) SampleWorkflowWithMutexRun

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

	// example.mutex.v1.Example.AcquireLock sends a(n) example.mutex.v1.Example.AcquireLock signal
	AcquireLock(ctx context.Context, workflowID string, runID string, signal *AcquireLockInput) error

	// example.mutex.v1.Example.LockAcquired sends a(n) example.mutex.v1.Example.LockAcquired signal
	LockAcquired(ctx context.Context, workflowID string, runID string, signal *LockAcquiredInput) error

	// example.mutex.v1.Example.ReleaseLock sends a(n) example.mutex.v1.Example.ReleaseLock signal
	ReleaseLock(ctx context.Context, workflowID string, runID string, signal *ReleaseLockInput) error
}

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

func NewExampleClient

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

NewExampleClient initializes a new example.mutex.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 {
	// Mutex executes a "example.mutex.v1.Example.Mutex" workflow inline
	Mutex(workflow.Context, *MutexInput) error
	// SampleWorkflowWithMutex executes a "example.mutex.v1.Example.SampleWorkflowWithMutex" workflow inline
	SampleWorkflowWithMutex(workflow.Context, *SampleWorkflowWithMutexInput) 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 {
	// Mutex initializes a new a(n) MutexWorkflow implementation
	Mutex(ctx workflow.Context, input *MutexWorkflowInput) (MutexWorkflow, error)

	// SampleWorkflowWithMutex initializes a new a(n) SampleWorkflowWithMutexWorkflow implementation
	SampleWorkflowWithMutex(ctx workflow.Context, input *SampleWorkflowWithMutexWorkflowInput) (SampleWorkflowWithMutexWorkflow, error)
}

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

type LockAcquiredInput

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

func UnmarshalCliFlagsToLockAcquiredInput

func UnmarshalCliFlagsToLockAcquiredInput(cmd *v2.Context) (*LockAcquiredInput, error)

UnmarshalCliFlagsToLockAcquiredInput unmarshals a LockAcquiredInput from command line flags

func (*LockAcquiredInput) Descriptor deprecated

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

Deprecated: Use LockAcquiredInput.ProtoReflect.Descriptor instead.

func (*LockAcquiredInput) GetLeaseId

func (x *LockAcquiredInput) GetLeaseId() string

func (*LockAcquiredInput) ProtoMessage

func (*LockAcquiredInput) ProtoMessage()

func (*LockAcquiredInput) ProtoReflect

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

func (*LockAcquiredInput) Reset

func (x *LockAcquiredInput) Reset()

func (*LockAcquiredInput) String

func (x *LockAcquiredInput) String() string

type LockAcquiredSignal

type LockAcquiredSignal struct {
	Channel workflow.ReceiveChannel
}

LockAcquiredSignal describes a(n) example.mutex.v1.Example.LockAcquired signal

func NewLockAcquiredSignal

func NewLockAcquiredSignal(ctx workflow.Context) *LockAcquiredSignal

NewLockAcquiredSignal initializes a new example.mutex.v1.Example.LockAcquired signal wrapper

func (*LockAcquiredSignal) Receive

Receive blocks until a(n) example.mutex.v1.Example.LockAcquired signal is received

func (*LockAcquiredSignal) ReceiveAsync

func (s *LockAcquiredSignal) ReceiveAsync() *LockAcquiredInput

ReceiveAsync checks for a example.mutex.v1.Example.LockAcquired signal without blocking

func (*LockAcquiredSignal) ReceiveWithTimeout

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

ReceiveWithTimeout blocks until a(n) example.mutex.v1.Example.LockAcquired 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 (*LockAcquiredSignal) Select

Select checks for a(n) example.mutex.v1.Example.LockAcquired signal without blocking

type MutexActivityOptions

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

MutexActivityOptions provides configuration for a(n) example.mutex.v1.Example.Mutex activity

func NewMutexActivityOptions

func NewMutexActivityOptions() *MutexActivityOptions

NewMutexActivityOptions sets default ActivityOptions

func (*MutexActivityOptions) WithActivityOptions

func (opts *MutexActivityOptions) WithActivityOptions(options workflow.ActivityOptions) *MutexActivityOptions

WithActivityOptions sets default ActivityOptions

type MutexChildOptions

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

MutexChildOptions provides configuration for a example.mutex.v1.Example.Mutex workflow operation

func NewMutexChildOptions

func NewMutexChildOptions() *MutexChildOptions

NewMutexChildOptions initializes a new MutexChildOptions value

func (*MutexChildOptions) WithChildWorkflowOptions

func (opts *MutexChildOptions) WithChildWorkflowOptions(options workflow.ChildWorkflowOptions) *MutexChildOptions

WithChildWorkflowOptions sets the initial client.StartWorkflowOptions

type MutexChildRun

type MutexChildRun struct {
	Future workflow.ChildWorkflowFuture
}

MutexChildRun describes a child Mutex workflow run

func MutexChildAsync

func MutexChildAsync(ctx workflow.Context, req *MutexInput, options ...*MutexChildOptions) (*MutexChildRun, error)

MutexChildAsync starts a child example.mutex.v1.Example.Mutex workflow and returns a handle to the child workflow run

func (*MutexChildRun) AcquireLock

func (r *MutexChildRun) AcquireLock(ctx workflow.Context, input *AcquireLockInput) error

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

func (*MutexChildRun) AcquireLockAsync

func (r *MutexChildRun) AcquireLockAsync(ctx workflow.Context, input *AcquireLockInput) workflow.Future

AcquireLockAsync sends a(n) "example.mutex.v1.Example.AcquireLock" signal request to the child workflow

func (*MutexChildRun) Get

func (r *MutexChildRun) Get(ctx workflow.Context) error

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

func (*MutexChildRun) ReleaseLock

func (r *MutexChildRun) ReleaseLock(ctx workflow.Context, input *ReleaseLockInput) error

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

func (*MutexChildRun) ReleaseLockAsync

func (r *MutexChildRun) ReleaseLockAsync(ctx workflow.Context, input *ReleaseLockInput) workflow.Future

ReleaseLockAsync sends a(n) "example.mutex.v1.Example.ReleaseLock" signal request to the child workflow

func (*MutexChildRun) Select

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

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

func (*MutexChildRun) SelectStart

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

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

func (*MutexChildRun) WaitStart

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

WaitStart waits for the child workflow to start

type MutexFuture

type MutexFuture struct {
	Future workflow.Future
}

MutexFuture describes a(n) example.mutex.v1.Example.Mutex activity execution

func MutexAsync

func MutexAsync(ctx workflow.Context, req *MutexInput, options ...*MutexActivityOptions) *MutexFuture

MutexAsync executes a(n) example.mutex.v1.Example.Mutex activity (asynchronously)

func MutexLocalAsync

func MutexLocalAsync(ctx workflow.Context, req *MutexInput, options ...*MutexLocalActivityOptions) *MutexFuture

MutexLocalAsync executes a(n) example.mutex.v1.Example.Mutex activity (asynchronously, locally)

func (*MutexFuture) Get

func (f *MutexFuture) Get(ctx workflow.Context) error

Get blocks on the activity's completion, returning the response

func (*MutexFuture) Select

func (f *MutexFuture) Select(sel workflow.Selector, fn func(*MutexFuture)) workflow.Selector

Select adds the activity's completion to the selector, callback can be nil

type MutexInput

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

func UnmarshalCliFlagsToMutexInput

func UnmarshalCliFlagsToMutexInput(cmd *v2.Context) (*MutexInput, error)

UnmarshalCliFlagsToMutexInput unmarshals a MutexInput from command line flags

func (*MutexInput) Descriptor deprecated

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

Deprecated: Use MutexInput.ProtoReflect.Descriptor instead.

func (*MutexInput) GetResourceId

func (x *MutexInput) GetResourceId() string

func (*MutexInput) ProtoMessage

func (*MutexInput) ProtoMessage()

func (*MutexInput) ProtoReflect

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

func (*MutexInput) Reset

func (x *MutexInput) Reset()

func (*MutexInput) String

func (x *MutexInput) String() string

type MutexLocalActivityOptions

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

MutexLocalActivityOptions provides configuration for a local example.mutex.v1.Example.Mutex activity

func NewMutexLocalActivityOptions

func NewMutexLocalActivityOptions() *MutexLocalActivityOptions

NewMutexLocalActivityOptions sets default LocalActivityOptions

func (*MutexLocalActivityOptions) Local

Local provides a local example.mutex.v1.Example.Mutex activity implementation

func (*MutexLocalActivityOptions) WithLocalActivityOptions

func (opts *MutexLocalActivityOptions) WithLocalActivityOptions(options workflow.LocalActivityOptions) *MutexLocalActivityOptions

WithLocalActivityOptions sets default LocalActivityOptions

type MutexOptions

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

MutexOptions provides configuration for a example.mutex.v1.Example.Mutex workflow operation

func NewMutexOptions

func NewMutexOptions() *MutexOptions

NewMutexOptions initializes a new MutexOptions value

func (*MutexOptions) WithStartWorkflowOptions

func (opts *MutexOptions) WithStartWorkflowOptions(options client.StartWorkflowOptions) *MutexOptions

WithStartWorkflowOptions sets the initial client.StartWorkflowOptions

type MutexRun

type MutexRun 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

	// example.mutex.v1.Example.AcquireLock sends a(n) example.mutex.v1.Example.AcquireLock signal
	AcquireLock(ctx context.Context, req *AcquireLockInput) error

	// example.mutex.v1.Example.ReleaseLock sends a(n) example.mutex.v1.Example.ReleaseLock signal
	ReleaseLock(ctx context.Context, req *ReleaseLockInput) error
}

MutexRun describes a(n) example.mutex.v1.Example.Mutex workflow run

type MutexWorkflow

type MutexWorkflow interface {
	// Execute defines the entrypoint to a(n) example.mutex.v1.Example.Mutex workflow
	Execute(ctx workflow.Context) error
}

MutexWorkflow describes a(n) example.mutex.v1.Example.Mutex workflow implementation

workflow details: (id: "mutex:${! resourceId }")

type MutexWorkflowInput

type MutexWorkflowInput struct {
	Req         *MutexInput
	AcquireLock *AcquireLockSignal
	ReleaseLock *ReleaseLockSignal
}

MutexWorkflowInput describes the input to a(n) example.mutex.v1.Example.Mutex workflow constructor

type ReleaseLockInput

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

func UnmarshalCliFlagsToReleaseLockInput

func UnmarshalCliFlagsToReleaseLockInput(cmd *v2.Context) (*ReleaseLockInput, error)

UnmarshalCliFlagsToReleaseLockInput unmarshals a ReleaseLockInput from command line flags

func (*ReleaseLockInput) Descriptor deprecated

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

Deprecated: Use ReleaseLockInput.ProtoReflect.Descriptor instead.

func (*ReleaseLockInput) GetLeaseId

func (x *ReleaseLockInput) GetLeaseId() string

func (*ReleaseLockInput) ProtoMessage

func (*ReleaseLockInput) ProtoMessage()

func (*ReleaseLockInput) ProtoReflect

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

func (*ReleaseLockInput) Reset

func (x *ReleaseLockInput) Reset()

func (*ReleaseLockInput) String

func (x *ReleaseLockInput) String() string

type ReleaseLockSignal

type ReleaseLockSignal struct {
	Channel workflow.ReceiveChannel
}

ReleaseLockSignal describes a(n) example.mutex.v1.Example.ReleaseLock signal

func NewReleaseLockSignal

func NewReleaseLockSignal(ctx workflow.Context) *ReleaseLockSignal

NewReleaseLockSignal initializes a new example.mutex.v1.Example.ReleaseLock signal wrapper

func (*ReleaseLockSignal) Receive

Receive blocks until a(n) example.mutex.v1.Example.ReleaseLock signal is received

func (*ReleaseLockSignal) ReceiveAsync

func (s *ReleaseLockSignal) ReceiveAsync() *ReleaseLockInput

ReceiveAsync checks for a example.mutex.v1.Example.ReleaseLock signal without blocking

func (*ReleaseLockSignal) ReceiveWithTimeout

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

ReceiveWithTimeout blocks until a(n) example.mutex.v1.Example.ReleaseLock 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 (*ReleaseLockSignal) Select

Select checks for a(n) example.mutex.v1.Example.ReleaseLock signal without blocking

type SampleWorkflowWithMutexChildOptions

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

SampleWorkflowWithMutexChildOptions provides configuration for a example.mutex.v1.Example.SampleWorkflowWithMutex workflow operation

func NewSampleWorkflowWithMutexChildOptions

func NewSampleWorkflowWithMutexChildOptions() *SampleWorkflowWithMutexChildOptions

NewSampleWorkflowWithMutexChildOptions initializes a new SampleWorkflowWithMutexChildOptions value

func (*SampleWorkflowWithMutexChildOptions) WithChildWorkflowOptions

WithChildWorkflowOptions sets the initial client.StartWorkflowOptions

type SampleWorkflowWithMutexChildRun

type SampleWorkflowWithMutexChildRun struct {
	Future workflow.ChildWorkflowFuture
}

SampleWorkflowWithMutexChildRun describes a child SampleWorkflowWithMutex workflow run

func SampleWorkflowWithMutexChildAsync

SampleWorkflowWithMutexChildAsync starts a child example.mutex.v1.Example.SampleWorkflowWithMutex workflow and returns a handle to the child workflow run

func (*SampleWorkflowWithMutexChildRun) Get

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

func (*SampleWorkflowWithMutexChildRun) LockAcquired

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

func (*SampleWorkflowWithMutexChildRun) LockAcquiredAsync

LockAcquiredAsync sends a(n) "example.mutex.v1.Example.LockAcquired" signal request to the child workflow

func (*SampleWorkflowWithMutexChildRun) Select

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

func (*SampleWorkflowWithMutexChildRun) SelectStart

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

func (*SampleWorkflowWithMutexChildRun) WaitStart

WaitStart waits for the child workflow to start

type SampleWorkflowWithMutexInput

type SampleWorkflowWithMutexInput struct {
	ResourceId string               `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"`
	Sleep      *durationpb.Duration `protobuf:"bytes,2,opt,name=sleep,proto3" json:"sleep,omitempty"`
	// contains filtered or unexported fields
}

func UnmarshalCliFlagsToSampleWorkflowWithMutexInput

func UnmarshalCliFlagsToSampleWorkflowWithMutexInput(cmd *v2.Context) (*SampleWorkflowWithMutexInput, error)

UnmarshalCliFlagsToSampleWorkflowWithMutexInput unmarshals a SampleWorkflowWithMutexInput from command line flags

func (*SampleWorkflowWithMutexInput) Descriptor deprecated

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

Deprecated: Use SampleWorkflowWithMutexInput.ProtoReflect.Descriptor instead.

func (*SampleWorkflowWithMutexInput) GetResourceId

func (x *SampleWorkflowWithMutexInput) GetResourceId() string

func (*SampleWorkflowWithMutexInput) GetSleep

func (*SampleWorkflowWithMutexInput) ProtoMessage

func (*SampleWorkflowWithMutexInput) ProtoMessage()

func (*SampleWorkflowWithMutexInput) ProtoReflect

func (*SampleWorkflowWithMutexInput) Reset

func (x *SampleWorkflowWithMutexInput) Reset()

func (*SampleWorkflowWithMutexInput) String

type SampleWorkflowWithMutexOptions

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

SampleWorkflowWithMutexOptions provides configuration for a example.mutex.v1.Example.SampleWorkflowWithMutex workflow operation

func NewSampleWorkflowWithMutexOptions

func NewSampleWorkflowWithMutexOptions() *SampleWorkflowWithMutexOptions

NewSampleWorkflowWithMutexOptions initializes a new SampleWorkflowWithMutexOptions value

func (*SampleWorkflowWithMutexOptions) WithStartWorkflowOptions

WithStartWorkflowOptions sets the initial client.StartWorkflowOptions

type SampleWorkflowWithMutexRun

type SampleWorkflowWithMutexRun 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

	// example.mutex.v1.Example.LockAcquired sends a(n) example.mutex.v1.Example.LockAcquired signal
	LockAcquired(ctx context.Context, req *LockAcquiredInput) error
}

SampleWorkflowWithMutexRun describes a(n) example.mutex.v1.Example.SampleWorkflowWithMutex workflow run

type SampleWorkflowWithMutexWorkflow

type SampleWorkflowWithMutexWorkflow interface {
	// Execute defines the entrypoint to a(n) example.mutex.v1.Example.SampleWorkflowWithMutex workflow
	Execute(ctx workflow.Context) error
}

SampleWorkflowWithMutexWorkflow describes a(n) example.mutex.v1.Example.SampleWorkflowWithMutex workflow implementation

workflow details: (id: "SampleWorkflow1WithMutex_${! uuid_v4() }")

type SampleWorkflowWithMutexWorkflowInput

type SampleWorkflowWithMutexWorkflowInput struct {
	Req          *SampleWorkflowWithMutexInput
	LockAcquired *LockAcquiredSignal
}

SampleWorkflowWithMutexWorkflowInput describes the input to a(n) example.mutex.v1.Example.SampleWorkflowWithMutex 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) AcquireLock

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

AcquireLock executes a example.mutex.v1.Example.AcquireLock signal

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

func (c *TestExampleClient) GetMutex(ctx context.Context, workflowID string, runID string) MutexRun

GetMutex is a noop

func (*TestExampleClient) GetSampleWorkflowWithMutex

func (c *TestExampleClient) GetSampleWorkflowWithMutex(ctx context.Context, workflowID string, runID string) SampleWorkflowWithMutexRun

GetSampleWorkflowWithMutex is a noop

func (*TestExampleClient) LockAcquired

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

LockAcquired executes a example.mutex.v1.Example.LockAcquired signal

func (*TestExampleClient) Mutex

func (c *TestExampleClient) Mutex(ctx context.Context, req *MutexInput, opts ...*MutexOptions) error

Mutex executes a(n) example.mutex.v1.Example.Mutex workflow in the test environment

func (*TestExampleClient) MutexAsync

func (c *TestExampleClient) MutexAsync(ctx context.Context, req *MutexInput, options ...*MutexOptions) (MutexRun, error)

MutexAsync executes a(n) example.mutex.v1.Example.Mutex workflow in the test environment

func (*TestExampleClient) MutexWithAcquireLock

func (c *TestExampleClient) MutexWithAcquireLock(ctx context.Context, req *MutexInput, signal *AcquireLockInput, opts ...*MutexOptions) error

MutexWithAcquireLock sends a(n) example.mutex.v1.Example.AcquireLock signal to a(n) example.mutex.v1.Example.Mutex workflow, starting it if necessary

func (*TestExampleClient) MutexWithAcquireLockAsync

func (c *TestExampleClient) MutexWithAcquireLockAsync(ctx context.Context, req *MutexInput, signal *AcquireLockInput, opts ...*MutexOptions) (MutexRun, error)

MutexWithAcquireLockAsync sends a(n) example.mutex.v1.Example.AcquireLock signal to a(n) example.mutex.v1.Example.Mutex workflow, starting it if necessary

func (*TestExampleClient) ReleaseLock

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

ReleaseLock executes a example.mutex.v1.Example.ReleaseLock signal

func (*TestExampleClient) SampleWorkflowWithMutex

SampleWorkflowWithMutex executes a(n) example.mutex.v1.Example.SampleWorkflowWithMutex workflow in the test environment

func (*TestExampleClient) SampleWorkflowWithMutexAsync

SampleWorkflowWithMutexAsync executes a(n) example.mutex.v1.Example.SampleWorkflowWithMutex 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