Documentation ¶
Index ¶
- Constants
- Variables
- func ExecuteActivity(d OrchestratorClient, wk *Workflow, activity ActivityInterface, ...) (interface{}, error)
- type ActivityInterface
- type ActivityRunInterface
- type Aggregate
- type AggregateInterface
- type Arg
- type ArgData
- type AuthAggregate
- type CustomFunc
- type CustomFuncData
- type Definition
- type Definitions
- type OrchestratorClient
- type RegisterEventsActivity
- func (a *RegisterEventsActivity) MarshalArgs() ([]byte, error)
- func (a *RegisterEventsActivity) MarshalResult(result interface{}) ([]byte, error)
- func (a *RegisterEventsActivity) Run(ctx context.Context) (interface{}, error)
- func (a *RegisterEventsActivity) UnmarshalArgs(data []byte) error
- func (a *RegisterEventsActivity) UnmarshalResult(data []byte, resultInterface interface{}) error
- type RequestConfig
- type StartWorkflowOptions
- type TransactionClient
- type WorkerInterface
- type Workflow
- type WorkflowInterface
- type WorkflowRun
- type WorkflowRunInterface
Constants ¶
const TimeType = "time.time"
Variables ¶
var MappingAggregate map[*libdomain.AggregateDefinition]*Aggregate
Definition is used to declare the information of a model, so it can generate its code.
Functions ¶
func ExecuteActivity ¶
func ExecuteActivity( d OrchestratorClient, wk *Workflow, activity ActivityInterface, activityClient TransactionClient, ) (interface{}, error)
Types ¶
type ActivityInterface ¶
type ActivityRunInterface ¶
type ActivityRunInterface interface {
Get(*Workflow, TransactionClient) (interface{}, error)
}
type Aggregate ¶
type Aggregate struct {
// contains filtered or unexported fields
}
Definition is used to declare the information of a model, so it can generate its code.
func (*Aggregate) Definition ¶
func (a *Aggregate) Definition() *Definition
func (*Aggregate) SetDefinition ¶
func (a *Aggregate) SetDefinition(definition *Definition)
type AggregateInterface ¶
type AggregateInterface interface {
Definition() *Definition
}
Definition is used to declare the information of a model, so it can generate its code.
type ArgData ¶
ArgData represent the argument of a custom function, in a format usable by templates.
type AuthAggregate ¶
type AuthAggregate interface { GetUserFromToken( libdomain.WorkflowInterface, *userpb.UserGetUserFromTokenCommand, ) (*userpb.UserGetUserFromTokenResults, error) }
type CustomFunc ¶
CustomFunc represent a custom function.
func (*CustomFunc) GetCustomFuncData ¶
func (c *CustomFunc) GetCustomFuncData() *CustomFuncData
GetCustomFuncData return the custom function information, in a format usable by templates.
type CustomFuncData ¶
CustomFuncData represent a custom function, in a format usable by templates.
type Definition ¶
type Definition struct { Aggregate libdomain.AggregateInterface GenDomain string Create *RequestConfig Update *RequestConfig Delete *RequestConfig CustomFuncs []*libdomain.CustomCommand Event bool // contains filtered or unexported fields }
Definition is used to declare the information of a model, so it can generate its code.
func (*Definition) GetCustomFuncByName ¶
func (d *Definition) GetCustomFuncByName(name string) *libdomain.CustomCommand
GetCustomFuncByName return the custom function by it's name
type Definitions ¶
type Definitions struct { Prefix string Repository string Tenant bool Auth bool // contains filtered or unexported fields }
Definitions contains all the grpc definitions in the service.
func (*Definitions) GetByID ¶
func (ds *Definitions) GetByID(id string) *Definition
GetByID return the specified definition by its ID.
func (*Definitions) Register ¶
func (ds *Definitions) Register(d *Definition)
Register is used to register a new definition into the service.
func (*Definitions) Slice ¶
func (ds *Definitions) Slice() []*Definition
Slice return the definitions as a slice.
type OrchestratorClient ¶
type OrchestratorClient interface { GetOrchestratorTransaction() interface{} RollbackOrchestratorTransaction(tx interface{}) CommitOrchestratorTransaction(tx interface{}) SearchWorkflow(string) (string, error) NewWorkflow( name string, idempotencyKey string, serializedArgs []byte, ) (string, error) GetWorkflow(id string) ( string, string, []byte, []byte, error) OnWorkflowError(name string) error OnWorkflowSuccess(name string, serializedResult []byte) error SearchActivity( workflowID string, step int, ) ([]byte, error) // NewActivity( // workflowID string, step int, serializedArgs []byte, // ) (string, error) // GetActivity(id string) ( string, string, int, []byte, []byte, error) OnActivitySuccess(workflowID string, step int, serializedResult []byte) error }
type RegisterEventsActivity ¶
type RegisterEventsActivity struct { EventStoreClient libdomain.EventStoreClient Workflow *Workflow Aggregate libdomain.AggregateInterface Events []*libdomain.Event }
func (*RegisterEventsActivity) MarshalArgs ¶
func (a *RegisterEventsActivity) MarshalArgs() ([]byte, error)
func (*RegisterEventsActivity) MarshalResult ¶
func (a *RegisterEventsActivity) MarshalResult(result interface{}) ([]byte, error)
func (*RegisterEventsActivity) Run ¶
func (a *RegisterEventsActivity) Run( ctx context.Context, ) (interface{}, error)
func (*RegisterEventsActivity) UnmarshalArgs ¶
func (a *RegisterEventsActivity) UnmarshalArgs(data []byte) error
func (*RegisterEventsActivity) UnmarshalResult ¶
func (a *RegisterEventsActivity) UnmarshalResult(data []byte, resultInterface interface{}) error
type RequestConfig ¶
type StartWorkflowOptions ¶
type TransactionClient ¶
type WorkerInterface ¶
type Workflow ¶
type Workflow struct { WorkflowID string WorkflowStep int // TenantID string Transaction interface{} TransactionClient TransactionClient TransactionAlwaysCommit bool UseTenants bool TenantClient libdomain.AggregateInterface OrchestratorClient OrchestratorClient // contains filtered or unexported fields }
func (*Workflow) SetWorkflow ¶
type WorkflowInterface ¶
type WorkflowRun ¶
type WorkflowRun struct {
// contains filtered or unexported fields
}
type WorkflowRunInterface ¶
func ExecuteWorkflow ¶
func ExecuteWorkflow( ctx context.Context, d OrchestratorClient, m *libdomain.AggregateDefinition, tenantID string, idempotencyKey string, workflow WorkflowInterface, options StartWorkflowOptions, transactionClient TransactionClient, tenantAggregate libdomain.AggregateInterface, ) (WorkflowRunInterface, error)