Documentation
¶
Overview ¶
Code generated by protoc-gen-go_temporal. DO NOT EDIT. versions:
protoc-gen-go_temporal go go1.19.5 protoc (unknown)
source: example.proto
Index ¶
- Constants
- Variables
- func AcquireLeaseExternal(ctx workflow.Context, workflowID string, runID string, req *AcquireLeaseSignal) workflow.Future
- func LeaseAcquiredExternal(ctx workflow.Context, workflowID string, runID string, ...) workflow.Future
- func RegisterActivities(r worker.Registry, activities Activities)
- func RegisterDeposit(r worker.Registry, ...)
- func RegisterLockAccount(r worker.Registry, ...)
- func RegisterTransfer(r worker.Registry, wf func(workflow.Context, *TransferInput) (Transfer, error))
- func RegisterWithdraw(r worker.Registry, ...)
- func RegisterWorkflows(r worker.Registry, workflows Workflows)
- func RenewLeaseExternal(ctx workflow.Context, workflowID string, runID string, req *RenewLeaseSignal) workflow.Future
- func RevokeLeaseExternal(ctx workflow.Context, workflowID string, runID string, req *RevokeLeaseSignal) workflow.Future
- type AcquireLease
- type AcquireLeaseSignal
- func (*AcquireLeaseSignal) Descriptor() ([]byte, []int)deprecated
- func (x *AcquireLeaseSignal) GetTimeout() *durationpb.Duration
- func (x *AcquireLeaseSignal) GetWorkflowId() string
- func (*AcquireLeaseSignal) ProtoMessage()
- func (x *AcquireLeaseSignal) ProtoReflect() protoreflect.Message
- func (x *AcquireLeaseSignal) Reset()
- func (x *AcquireLeaseSignal) String() string
- type Activities
- type Client
- type DepositFuture
- type DepositRequest
- func (*DepositRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DepositRequest) GetAccount() string
- func (x *DepositRequest) GetAmount() float64
- func (*DepositRequest) ProtoMessage()
- func (x *DepositRequest) ProtoReflect() protoreflect.Message
- func (x *DepositRequest) Reset()
- func (x *DepositRequest) String() string
- type DepositResponse
- type LeaseAcquired
- type LeaseAcquiredSignal
- func (*LeaseAcquiredSignal) Descriptor() ([]byte, []int)deprecated
- func (x *LeaseAcquiredSignal) GetLeaseId() string
- func (x *LeaseAcquiredSignal) GetRunId() string
- func (x *LeaseAcquiredSignal) GetWorkflowId() string
- func (*LeaseAcquiredSignal) ProtoMessage()
- func (x *LeaseAcquiredSignal) ProtoReflect() protoreflect.Message
- func (x *LeaseAcquiredSignal) Reset()
- func (x *LeaseAcquiredSignal) String() string
- type LockAccount
- type LockAccountChildRun
- func (r *LockAccountChildRun) AcquireLease(ctx workflow.Context, input *AcquireLeaseSignal) workflow.Future
- func (r *LockAccountChildRun) Get(ctx workflow.Context) error
- func (r *LockAccountChildRun) RenewLease(ctx workflow.Context, input *RenewLeaseSignal) workflow.Future
- func (r *LockAccountChildRun) RevokeLease(ctx workflow.Context, input *RevokeLeaseSignal) workflow.Future
- func (r *LockAccountChildRun) Select(sel workflow.Selector, fn func(LockAccountChildRun)) workflow.Selector
- func (r *LockAccountChildRun) SelectStart(sel workflow.Selector, fn func(LockAccountChildRun)) workflow.Selector
- func (r *LockAccountChildRun) WaitStart(ctx workflow.Context) (*workflow.Execution, error)
- type LockAccountInput
- type LockAccountRequest
- func (*LockAccountRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LockAccountRequest) GetAccount() string
- func (*LockAccountRequest) ProtoMessage()
- func (x *LockAccountRequest) ProtoReflect() protoreflect.Message
- func (x *LockAccountRequest) Reset()
- func (x *LockAccountRequest) String() string
- type LockAccountRun
- type RenewLease
- type RenewLeaseSignal
- func (*RenewLeaseSignal) Descriptor() ([]byte, []int)deprecated
- func (x *RenewLeaseSignal) GetLeaseId() string
- func (x *RenewLeaseSignal) GetTimeout() *durationpb.Duration
- func (*RenewLeaseSignal) ProtoMessage()
- func (x *RenewLeaseSignal) ProtoReflect() protoreflect.Message
- func (x *RenewLeaseSignal) Reset()
- func (x *RenewLeaseSignal) String() string
- type RevokeLease
- type RevokeLeaseSignal
- type Transfer
- type TransferChildRun
- func (r *TransferChildRun) Get(ctx workflow.Context) (*TransferResponse, error)
- func (r *TransferChildRun) LeaseAcquired(ctx workflow.Context, input *LeaseAcquiredSignal) workflow.Future
- func (r *TransferChildRun) Select(sel workflow.Selector, fn func(TransferChildRun)) workflow.Selector
- func (r *TransferChildRun) SelectStart(sel workflow.Selector, fn func(TransferChildRun)) workflow.Selector
- func (r *TransferChildRun) WaitStart(ctx workflow.Context) (*workflow.Execution, error)
- type TransferInput
- type TransferRequest
- func (*TransferRequest) Descriptor() ([]byte, []int)deprecated
- func (x *TransferRequest) GetAmount() float64
- func (x *TransferRequest) GetDest() string
- func (x *TransferRequest) GetSrc() string
- func (*TransferRequest) ProtoMessage()
- func (x *TransferRequest) ProtoReflect() protoreflect.Message
- func (x *TransferRequest) Reset()
- func (x *TransferRequest) String() string
- type TransferResponse
- type TransferRun
- type WithdrawFuture
- type WithdrawRequest
- func (*WithdrawRequest) Descriptor() ([]byte, []int)deprecated
- func (x *WithdrawRequest) GetAccount() string
- func (x *WithdrawRequest) GetAmount() float64
- func (*WithdrawRequest) ProtoMessage()
- func (x *WithdrawRequest) ProtoReflect() protoreflect.Message
- func (x *WithdrawRequest) Reset()
- func (x *WithdrawRequest) String() string
- type WithdrawResponse
- type Workflows
Constants ¶
const ( LockAccountName = "mycompany.foo.v1.Foo.LockAccount" TransferName = "mycompany.foo.v1.Foo.Transfer" )
Foo workflow names
const ( LockAccountIDPrefix = "lock" TransferIDPrefix = "transfer" )
Foo id prefixes
const ( AcquireLeaseName = "mycompany.foo.v1.Foo.AcquireLease" LeaseAcquiredName = "mycompany.foo.v1.Foo.LeaseAcquired" RenewLeaseName = "mycompany.foo.v1.Foo.RenewLease" RevokeLeaseName = "mycompany.foo.v1.Foo.RevokeLease" )
Foo signal names
const ( DepositName = "mycompany.foo.v1.Foo.Deposit" WithdrawName = "mycompany.foo.v1.Foo.Withdraw" )
Foo activity names
Variables ¶
var File_example_proto protoreflect.FileDescriptor
Functions ¶
func AcquireLeaseExternal ¶
func AcquireLeaseExternal(ctx workflow.Context, workflowID string, runID string, req *AcquireLeaseSignal) workflow.Future
AcquireLeaseExternal sends a AcquireLease signal to an existing workflow
func LeaseAcquiredExternal ¶
func LeaseAcquiredExternal(ctx workflow.Context, workflowID string, runID string, req *LeaseAcquiredSignal) workflow.Future
LeaseAcquiredExternal sends a LeaseAcquired signal to an existing workflow
func RegisterActivities ¶
func RegisterActivities(r worker.Registry, activities Activities)
RegisterActivities registers activities with a worker
func RegisterDeposit ¶
func RegisterDeposit(r worker.Registry, fn func(context.Context, *DepositRequest) (*DepositResponse, error))
RegisterDeposit registers a Deposit activity
func RegisterLockAccount ¶
func RegisterLockAccount(r worker.Registry, wf func(workflow.Context, *LockAccountInput) (LockAccount, error))
RegisterLockAccount registers a LockAccount workflow with the given worker
func RegisterTransfer ¶
func RegisterTransfer(r worker.Registry, wf func(workflow.Context, *TransferInput) (Transfer, error))
RegisterTransfer registers a Transfer workflow with the given worker
func RegisterWithdraw ¶
func RegisterWithdraw(r worker.Registry, fn func(context.Context, *WithdrawRequest) (*WithdrawResponse, error))
RegisterWithdraw registers a Withdraw activity
func RegisterWorkflows ¶
RegisterWorkflows registers Foo workflows with the given worker
func RenewLeaseExternal ¶
func RenewLeaseExternal(ctx workflow.Context, workflowID string, runID string, req *RenewLeaseSignal) workflow.Future
RenewLeaseExternal sends a RenewLease signal to an existing workflow
func RevokeLeaseExternal ¶
func RevokeLeaseExternal(ctx workflow.Context, workflowID string, runID string, req *RevokeLeaseSignal) workflow.Future
RevokeLeaseExternal sends a RevokeLease signal to an existing workflow
Types ¶
type AcquireLease ¶
type AcquireLease struct {
Channel workflow.ReceiveChannel
}
AcquireLease describes a AcquireLease signal
func (*AcquireLease) Receive ¶
func (s *AcquireLease) Receive(ctx workflow.Context) (*AcquireLeaseSignal, bool)
Receive blocks until a AcquireLease signal is received
func (*AcquireLease) ReceiveAsync ¶
func (s *AcquireLease) ReceiveAsync() *AcquireLeaseSignal
ReceiveAsync checks for a AcquireLease signal without blocking
func (*AcquireLease) Select ¶
func (s *AcquireLease) Select(sel workflow.Selector, fn func(*AcquireLeaseSignal)) workflow.Selector
Select checks for a AcquireLease signal without blocking
type AcquireLeaseSignal ¶
type AcquireLeaseSignal 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 (*AcquireLeaseSignal) Descriptor
deprecated
func (*AcquireLeaseSignal) Descriptor() ([]byte, []int)
Deprecated: Use AcquireLeaseSignal.ProtoReflect.Descriptor instead.
func (*AcquireLeaseSignal) GetTimeout ¶
func (x *AcquireLeaseSignal) GetTimeout() *durationpb.Duration
func (*AcquireLeaseSignal) GetWorkflowId ¶
func (x *AcquireLeaseSignal) GetWorkflowId() string
func (*AcquireLeaseSignal) ProtoMessage ¶
func (*AcquireLeaseSignal) ProtoMessage()
func (*AcquireLeaseSignal) ProtoReflect ¶
func (x *AcquireLeaseSignal) ProtoReflect() protoreflect.Message
func (*AcquireLeaseSignal) Reset ¶
func (x *AcquireLeaseSignal) Reset()
func (*AcquireLeaseSignal) String ¶
func (x *AcquireLeaseSignal) String() string
type Activities ¶
type Activities interface {
// Deposit amount into an account
Deposit(ctx context.Context, req *DepositRequest) (*DepositResponse, error)
// Withdraw amount from an account
Withdraw(ctx context.Context, req *WithdrawRequest) (*WithdrawResponse, error)
}
Activities describes available worker activites
type Client ¶
type Client interface {
// ExecuteLockAccount executes a LockAccount workflow
ExecuteLockAccount(ctx context.Context, opts *client.StartWorkflowOptions, req *LockAccountRequest) (LockAccountRun, error)
// GetLockAccount retrieves a LockAccount workflow execution
GetLockAccount(ctx context.Context, workflowID string, runID string) (LockAccountRun, error)
// StartLockAccountWithAcquireLease sends a AcquireLease signal to a LockAccount workflow, starting it if not present
StartLockAccountWithAcquireLease(ctx context.Context, opts *client.StartWorkflowOptions, req *LockAccountRequest, signal *AcquireLeaseSignal) (LockAccountRun, error)
// ExecuteTransfer executes a Transfer workflow
ExecuteTransfer(ctx context.Context, opts *client.StartWorkflowOptions, req *TransferRequest) (TransferRun, error)
// GetTransfer retrieves a Transfer workflow execution
GetTransfer(ctx context.Context, workflowID string, runID string) (TransferRun, error)
// AcquireLeaseends a AcquireLease signal to an existing workflow
AcquireLease(ctx context.Context, workflowID string, runID string, signal *AcquireLeaseSignal) error
// LeaseAcquiredends a LeaseAcquired signal to an existing workflow
LeaseAcquired(ctx context.Context, workflowID string, runID string, signal *LeaseAcquiredSignal) error
// RenewLeaseends a RenewLease signal to an existing workflow
RenewLease(ctx context.Context, workflowID string, runID string, signal *RenewLeaseSignal) error
// RevokeLeaseends a RevokeLease signal to an existing workflow
RevokeLease(ctx context.Context, workflowID string, runID string, signal *RevokeLeaseSignal) error
}
Client describes a client for a Foo worker
type DepositFuture ¶
DepositFuture describes a Deposit activity execution
func Deposit ¶
func Deposit(ctx workflow.Context, opts *workflow.ActivityOptions, req *DepositRequest) *DepositFuture
Deposit amount into an account
func DepositLocal ¶
func DepositLocal(ctx workflow.Context, opts *workflow.LocalActivityOptions, fn func(context.Context, *DepositRequest) (*DepositResponse, error), req *DepositRequest) *DepositFuture
Deposit amount into an account
func (*DepositFuture) Get ¶
func (f *DepositFuture) Get(ctx workflow.Context) (*DepositResponse, error)
Get blocks on a Deposit execution, returning the response
func (*DepositFuture) Select ¶
func (f *DepositFuture) Select(sel workflow.Selector, fn func(*DepositFuture)) workflow.Selector
Select adds the Deposit completion to the selector, callback can be nil
type DepositRequest ¶
type DepositRequest struct {
Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
Amount float64 `protobuf:"fixed64,2,opt,name=amount,proto3" json:"amount,omitempty"`
// contains filtered or unexported fields
}
func (*DepositRequest) Descriptor
deprecated
func (*DepositRequest) Descriptor() ([]byte, []int)
Deprecated: Use DepositRequest.ProtoReflect.Descriptor instead.
func (*DepositRequest) GetAccount ¶
func (x *DepositRequest) GetAccount() string
func (*DepositRequest) GetAmount ¶
func (x *DepositRequest) GetAmount() float64
func (*DepositRequest) ProtoMessage ¶
func (*DepositRequest) ProtoMessage()
func (*DepositRequest) ProtoReflect ¶
func (x *DepositRequest) ProtoReflect() protoreflect.Message
func (*DepositRequest) Reset ¶
func (x *DepositRequest) Reset()
func (*DepositRequest) String ¶
func (x *DepositRequest) String() string
type DepositResponse ¶
type DepositResponse struct {
Result string `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
// contains filtered or unexported fields
}
func (*DepositResponse) Descriptor
deprecated
func (*DepositResponse) Descriptor() ([]byte, []int)
Deprecated: Use DepositResponse.ProtoReflect.Descriptor instead.
func (*DepositResponse) GetResult ¶
func (x *DepositResponse) GetResult() string
func (*DepositResponse) ProtoMessage ¶
func (*DepositResponse) ProtoMessage()
func (*DepositResponse) ProtoReflect ¶
func (x *DepositResponse) ProtoReflect() protoreflect.Message
func (*DepositResponse) Reset ¶
func (x *DepositResponse) Reset()
func (*DepositResponse) String ¶
func (x *DepositResponse) String() string
type LeaseAcquired ¶
type LeaseAcquired struct {
Channel workflow.ReceiveChannel
}
LeaseAcquired describes a LeaseAcquired signal
func (*LeaseAcquired) Receive ¶
func (s *LeaseAcquired) Receive(ctx workflow.Context) (*LeaseAcquiredSignal, bool)
Receive blocks until a LeaseAcquired signal is received
func (*LeaseAcquired) ReceiveAsync ¶
func (s *LeaseAcquired) ReceiveAsync() *LeaseAcquiredSignal
ReceiveAsync checks for a LeaseAcquired signal without blocking
func (*LeaseAcquired) Select ¶
func (s *LeaseAcquired) Select(sel workflow.Selector, fn func(*LeaseAcquiredSignal)) workflow.Selector
Select checks for a LeaseAcquired signal without blocking
type LeaseAcquiredSignal ¶
type LeaseAcquiredSignal struct {
WorkflowId string `protobuf:"bytes,1,opt,name=workflow_id,json=workflowId,proto3" json:"workflow_id,omitempty"`
RunId string `protobuf:"bytes,2,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"`
LeaseId string `protobuf:"bytes,3,opt,name=lease_id,json=leaseId,proto3" json:"lease_id,omitempty"`
// contains filtered or unexported fields
}
func (*LeaseAcquiredSignal) Descriptor
deprecated
func (*LeaseAcquiredSignal) Descriptor() ([]byte, []int)
Deprecated: Use LeaseAcquiredSignal.ProtoReflect.Descriptor instead.
func (*LeaseAcquiredSignal) GetLeaseId ¶
func (x *LeaseAcquiredSignal) GetLeaseId() string
func (*LeaseAcquiredSignal) GetRunId ¶
func (x *LeaseAcquiredSignal) GetRunId() string
func (*LeaseAcquiredSignal) GetWorkflowId ¶
func (x *LeaseAcquiredSignal) GetWorkflowId() string
func (*LeaseAcquiredSignal) ProtoMessage ¶
func (*LeaseAcquiredSignal) ProtoMessage()
func (*LeaseAcquiredSignal) ProtoReflect ¶
func (x *LeaseAcquiredSignal) ProtoReflect() protoreflect.Message
func (*LeaseAcquiredSignal) Reset ¶
func (x *LeaseAcquiredSignal) Reset()
func (*LeaseAcquiredSignal) String ¶
func (x *LeaseAcquiredSignal) String() string
type LockAccount ¶
type LockAccount interface {
// Execute a LockAccount workflow
Execute(ctx workflow.Context) error
}
LockAccount describes a LockAccount workflow implementation
type LockAccountChildRun ¶
type LockAccountChildRun struct {
Future workflow.ChildWorkflowFuture
}
LockAccountChildRun describes a child LockAccount workflow run
func LockAccountChild ¶
func LockAccountChild(ctx workflow.Context, opts *workflow.ChildWorkflowOptions, req *LockAccountRequest) LockAccountChildRun
LockAccountChild executes a child LockAccount workflow
func (*LockAccountChildRun) AcquireLease ¶
func (r *LockAccountChildRun) AcquireLease(ctx workflow.Context, input *AcquireLeaseSignal) workflow.Future
AcquireLease sends the corresponding signal request to the child workflow
func (*LockAccountChildRun) Get ¶
func (r *LockAccountChildRun) Get(ctx workflow.Context) error
Get blocks until the workflow is completed, returning the response value
func (*LockAccountChildRun) RenewLease ¶
func (r *LockAccountChildRun) RenewLease(ctx workflow.Context, input *RenewLeaseSignal) workflow.Future
RenewLease sends the corresponding signal request to the child workflow
func (*LockAccountChildRun) RevokeLease ¶
func (r *LockAccountChildRun) RevokeLease(ctx workflow.Context, input *RevokeLeaseSignal) workflow.Future
RevokeLease sends the corresponding signal request to the child workflow
func (*LockAccountChildRun) Select ¶
func (r *LockAccountChildRun) Select(sel workflow.Selector, fn func(LockAccountChildRun)) workflow.Selector
Select adds this completion to the selector. Callback can be nil.
func (*LockAccountChildRun) SelectStart ¶
func (r *LockAccountChildRun) SelectStart(sel workflow.Selector, fn func(LockAccountChildRun)) workflow.Selector
SelectStart adds waiting for start to the selector. Callback can be nil.
type LockAccountInput ¶
type LockAccountInput struct {
Req *LockAccountRequest
AcquireLease *AcquireLease
RenewLease *RenewLease
RevokeLease *RevokeLease
}
LockAccountInput describes the input to a LockAccount workflow constructor
type LockAccountRequest ¶
type LockAccountRequest struct {
Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
// contains filtered or unexported fields
}
func (*LockAccountRequest) Descriptor
deprecated
func (*LockAccountRequest) Descriptor() ([]byte, []int)
Deprecated: Use LockAccountRequest.ProtoReflect.Descriptor instead.
func (*LockAccountRequest) GetAccount ¶
func (x *LockAccountRequest) GetAccount() string
func (*LockAccountRequest) ProtoMessage ¶
func (*LockAccountRequest) ProtoMessage()
func (*LockAccountRequest) ProtoReflect ¶
func (x *LockAccountRequest) ProtoReflect() protoreflect.Message
func (*LockAccountRequest) Reset ¶
func (x *LockAccountRequest) Reset()
func (*LockAccountRequest) String ¶
func (x *LockAccountRequest) String() string
type LockAccountRun ¶
type LockAccountRun interface {
// ID returns the workflow ID
ID() string
// RunID returns the workflow instance ID
RunID() string
// Get blocks until the workflow is complete and returns the result
Get(ctx context.Context) error
// AcquireLease sends a AcquireLease signal to the workflow
AcquireLease(ctx context.Context, req *AcquireLeaseSignal) error
// RenewLease sends a RenewLease signal to the workflow
RenewLease(ctx context.Context, req *RenewLeaseSignal) error
// RevokeLease sends a RevokeLease signal to the workflow
RevokeLease(ctx context.Context, req *RevokeLeaseSignal) error
}
LockAccountRun describes a LockAccount workflow run
type RenewLease ¶
type RenewLease struct {
Channel workflow.ReceiveChannel
}
RenewLease describes a RenewLease signal
func (*RenewLease) Receive ¶
func (s *RenewLease) Receive(ctx workflow.Context) (*RenewLeaseSignal, bool)
Receive blocks until a RenewLease signal is received
func (*RenewLease) ReceiveAsync ¶
func (s *RenewLease) ReceiveAsync() *RenewLeaseSignal
ReceiveAsync checks for a RenewLease signal without blocking
func (*RenewLease) Select ¶
func (s *RenewLease) Select(sel workflow.Selector, fn func(*RenewLeaseSignal)) workflow.Selector
Select checks for a RenewLease signal without blocking
type RenewLeaseSignal ¶
type RenewLeaseSignal struct {
LeaseId string `protobuf:"bytes,1,opt,name=lease_id,json=leaseId,proto3" json:"lease_id,omitempty"`
Timeout *durationpb.Duration `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"`
// contains filtered or unexported fields
}
func (*RenewLeaseSignal) Descriptor
deprecated
func (*RenewLeaseSignal) Descriptor() ([]byte, []int)
Deprecated: Use RenewLeaseSignal.ProtoReflect.Descriptor instead.
func (*RenewLeaseSignal) GetLeaseId ¶
func (x *RenewLeaseSignal) GetLeaseId() string
func (*RenewLeaseSignal) GetTimeout ¶
func (x *RenewLeaseSignal) GetTimeout() *durationpb.Duration
func (*RenewLeaseSignal) ProtoMessage ¶
func (*RenewLeaseSignal) ProtoMessage()
func (*RenewLeaseSignal) ProtoReflect ¶
func (x *RenewLeaseSignal) ProtoReflect() protoreflect.Message
func (*RenewLeaseSignal) Reset ¶
func (x *RenewLeaseSignal) Reset()
func (*RenewLeaseSignal) String ¶
func (x *RenewLeaseSignal) String() string
type RevokeLease ¶
type RevokeLease struct {
Channel workflow.ReceiveChannel
}
RevokeLease describes a RevokeLease signal
func (*RevokeLease) Receive ¶
func (s *RevokeLease) Receive(ctx workflow.Context) (*RevokeLeaseSignal, bool)
Receive blocks until a RevokeLease signal is received
func (*RevokeLease) ReceiveAsync ¶
func (s *RevokeLease) ReceiveAsync() *RevokeLeaseSignal
ReceiveAsync checks for a RevokeLease signal without blocking
func (*RevokeLease) Select ¶
func (s *RevokeLease) Select(sel workflow.Selector, fn func(*RevokeLeaseSignal)) workflow.Selector
Select checks for a RevokeLease signal without blocking
type RevokeLeaseSignal ¶
type RevokeLeaseSignal struct {
LeaseId string `protobuf:"bytes,1,opt,name=lease_id,json=leaseId,proto3" json:"lease_id,omitempty"`
// contains filtered or unexported fields
}
func (*RevokeLeaseSignal) Descriptor
deprecated
func (*RevokeLeaseSignal) Descriptor() ([]byte, []int)
Deprecated: Use RevokeLeaseSignal.ProtoReflect.Descriptor instead.
func (*RevokeLeaseSignal) GetLeaseId ¶
func (x *RevokeLeaseSignal) GetLeaseId() string
func (*RevokeLeaseSignal) ProtoMessage ¶
func (*RevokeLeaseSignal) ProtoMessage()
func (*RevokeLeaseSignal) ProtoReflect ¶
func (x *RevokeLeaseSignal) ProtoReflect() protoreflect.Message
func (*RevokeLeaseSignal) Reset ¶
func (x *RevokeLeaseSignal) Reset()
func (*RevokeLeaseSignal) String ¶
func (x *RevokeLeaseSignal) String() string
type Transfer ¶
type Transfer interface {
// Execute a Transfer workflow
Execute(ctx workflow.Context) (*TransferResponse, error)
}
Transfer describes a Transfer workflow implementation
type TransferChildRun ¶
type TransferChildRun struct {
Future workflow.ChildWorkflowFuture
}
TransferChildRun describes a child Transfer workflow run
func TransferChild ¶
func TransferChild(ctx workflow.Context, opts *workflow.ChildWorkflowOptions, req *TransferRequest) TransferChildRun
TransferChild executes a child Transfer workflow
func (*TransferChildRun) Get ¶
func (r *TransferChildRun) Get(ctx workflow.Context) (*TransferResponse, error)
Get blocks until the workflow is completed, returning the response value
func (*TransferChildRun) LeaseAcquired ¶
func (r *TransferChildRun) LeaseAcquired(ctx workflow.Context, input *LeaseAcquiredSignal) workflow.Future
LeaseAcquired sends the corresponding signal request to the child workflow
func (*TransferChildRun) Select ¶
func (r *TransferChildRun) Select(sel workflow.Selector, fn func(TransferChildRun)) workflow.Selector
Select adds this completion to the selector. Callback can be nil.
func (*TransferChildRun) SelectStart ¶
func (r *TransferChildRun) SelectStart(sel workflow.Selector, fn func(TransferChildRun)) workflow.Selector
SelectStart adds waiting for start to the selector. Callback can be nil.
type TransferInput ¶
type TransferInput struct {
Req *TransferRequest
LeaseAcquired *LeaseAcquired
}
TransferInput describes the input to a Transfer workflow constructor
type TransferRequest ¶
type TransferRequest struct {
Src string `protobuf:"bytes,1,opt,name=src,proto3" json:"src,omitempty"`
Dest string `protobuf:"bytes,2,opt,name=dest,proto3" json:"dest,omitempty"`
Amount float64 `protobuf:"fixed64,3,opt,name=amount,proto3" json:"amount,omitempty"`
// contains filtered or unexported fields
}
func (*TransferRequest) Descriptor
deprecated
func (*TransferRequest) Descriptor() ([]byte, []int)
Deprecated: Use TransferRequest.ProtoReflect.Descriptor instead.
func (*TransferRequest) GetAmount ¶
func (x *TransferRequest) GetAmount() float64
func (*TransferRequest) GetDest ¶
func (x *TransferRequest) GetDest() string
func (*TransferRequest) GetSrc ¶
func (x *TransferRequest) GetSrc() string
func (*TransferRequest) ProtoMessage ¶
func (*TransferRequest) ProtoMessage()
func (*TransferRequest) ProtoReflect ¶
func (x *TransferRequest) ProtoReflect() protoreflect.Message
func (*TransferRequest) Reset ¶
func (x *TransferRequest) Reset()
func (*TransferRequest) String ¶
func (x *TransferRequest) String() string
type TransferResponse ¶
type TransferResponse struct {
Result string `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
// contains filtered or unexported fields
}
func (*TransferResponse) Descriptor
deprecated
func (*TransferResponse) Descriptor() ([]byte, []int)
Deprecated: Use TransferResponse.ProtoReflect.Descriptor instead.
func (*TransferResponse) GetResult ¶
func (x *TransferResponse) GetResult() string
func (*TransferResponse) ProtoMessage ¶
func (*TransferResponse) ProtoMessage()
func (*TransferResponse) ProtoReflect ¶
func (x *TransferResponse) ProtoReflect() protoreflect.Message
func (*TransferResponse) Reset ¶
func (x *TransferResponse) Reset()
func (*TransferResponse) String ¶
func (x *TransferResponse) String() string
type TransferRun ¶
type TransferRun interface {
// ID returns the workflow ID
ID() string
// RunID returns the workflow instance ID
RunID() string
// Get blocks until the workflow is complete and returns the result
Get(ctx context.Context) (*TransferResponse, error)
// LeaseAcquired sends a LeaseAcquired signal to the workflow
LeaseAcquired(ctx context.Context, req *LeaseAcquiredSignal) error
}
TransferRun describes a Transfer workflow run
type WithdrawFuture ¶
WithdrawFuture describes a Withdraw activity execution
func Withdraw ¶
func Withdraw(ctx workflow.Context, opts *workflow.ActivityOptions, req *WithdrawRequest) *WithdrawFuture
Withdraw amount from an account
func WithdrawLocal ¶
func WithdrawLocal(ctx workflow.Context, opts *workflow.LocalActivityOptions, fn func(context.Context, *WithdrawRequest) (*WithdrawResponse, error), req *WithdrawRequest) *WithdrawFuture
Withdraw amount from an account
func (*WithdrawFuture) Get ¶
func (f *WithdrawFuture) Get(ctx workflow.Context) (*WithdrawResponse, error)
Get blocks on a Withdraw execution, returning the response
func (*WithdrawFuture) Select ¶
func (f *WithdrawFuture) Select(sel workflow.Selector, fn func(*WithdrawFuture)) workflow.Selector
Select adds the Withdraw completion to the selector, callback can be nil
type WithdrawRequest ¶
type WithdrawRequest struct {
Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
Amount float64 `protobuf:"fixed64,2,opt,name=amount,proto3" json:"amount,omitempty"`
// contains filtered or unexported fields
}
func (*WithdrawRequest) Descriptor
deprecated
func (*WithdrawRequest) Descriptor() ([]byte, []int)
Deprecated: Use WithdrawRequest.ProtoReflect.Descriptor instead.
func (*WithdrawRequest) GetAccount ¶
func (x *WithdrawRequest) GetAccount() string
func (*WithdrawRequest) GetAmount ¶
func (x *WithdrawRequest) GetAmount() float64
func (*WithdrawRequest) ProtoMessage ¶
func (*WithdrawRequest) ProtoMessage()
func (*WithdrawRequest) ProtoReflect ¶
func (x *WithdrawRequest) ProtoReflect() protoreflect.Message
func (*WithdrawRequest) Reset ¶
func (x *WithdrawRequest) Reset()
func (*WithdrawRequest) String ¶
func (x *WithdrawRequest) String() string
type WithdrawResponse ¶
type WithdrawResponse struct {
Result string `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
// contains filtered or unexported fields
}
func (*WithdrawResponse) Descriptor
deprecated
func (*WithdrawResponse) Descriptor() ([]byte, []int)
Deprecated: Use WithdrawResponse.ProtoReflect.Descriptor instead.
func (*WithdrawResponse) GetResult ¶
func (x *WithdrawResponse) GetResult() string
func (*WithdrawResponse) ProtoMessage ¶
func (*WithdrawResponse) ProtoMessage()
func (*WithdrawResponse) ProtoReflect ¶
func (x *WithdrawResponse) ProtoReflect() protoreflect.Message
func (*WithdrawResponse) Reset ¶
func (x *WithdrawResponse) Reset()
func (*WithdrawResponse) String ¶
func (x *WithdrawResponse) String() string
type Workflows ¶
type Workflows interface {
// LockAccount initializes a new LockAccountWorkflow value
LockAccount(ctx workflow.Context, input *LockAccountInput) (LockAccount, error)
// Transfer initializes a new TransferWorkflow value
Transfer(ctx workflow.Context, input *TransferInput) (Transfer, error)
}
Workflows provides methods for initializing new Foo workflow values