Documentation ¶
Index ¶
- type ClientInfo
- type Driver
- func (d *Driver) BeginTransaction(wf *libapplication.Workflow, useCache bool) error
- func (d *Driver) CheckIDExist(model *libdomain.EntityDefinition, wk *libapplication.Workflow, id string) error
- func (c *Driver) Close()
- func (c *Driver) CommitOrchestratorTransaction(tx interface{})
- func (d *Driver) CommitTransaction(wk *libapplication.Workflow) error
- func (d *Driver) CreateTenant(wk *libdata.Workflow, models []*libdata.ModelDefinition, ...) error
- func (d *Driver) Delete(model libdomain.TableInterface, wk *libapplication.Workflow, ...) error
- func (d *Driver) EventsKO(wk *libdata.Workflow, aggregate string, aggregateID string, name string, ...) (libdata.EventInterface, error)
- func (d *Driver) EventsOK(wk *libdata.Workflow, aggregate string, aggregateID string, name string, ...) (libdata.EventInterface, error)
- func (d *Driver) GenerateScanFunc(table libdomain.TableInterface) string
- func (d *Driver) Get(t *libdomain.EntityDefinition, wk *libapplication.Workflow, id string) (interface{}, error)
- func (d *Driver) GetAggregateEvents(wk libdomain.WorkflowInterface, a libdomain.AggregateInterface, id string) ([]*libdomain.Event, error)
- func (d *Driver) GetConnection() *sqlx.DB
- func (d *Driver) GetImportRepository() string
- func (c *Driver) GetOrchestratorTransaction() interface{}
- func (d *Driver) GetTenant(wk *libdata.Workflow, tenant *libdata.Tenant) (*libdata.Tenant, error)
- func (c *Driver) GetWorker(taskQueue interface{}, options interface{}) libdata.WorkerInterface
- func (c *Driver) GetWorkflow(id string) (string, string, []byte, []byte, error)
- func (d *Driver) InitDB(writeInfo *libdata.ClusterInfo, readInfo *libdata.ClusterInfo) (*libdata.Cluster, error)
- func (d *Driver) Insert(t libdomain.TableInterface, wk *libapplication.Workflow, records []interface{}, ...) (interface{}, error)
- func (d *Driver) MarkDispatchedEvent(wk libdomain.WorkflowInterface, event *libdomain.Event) error
- func (d *Driver) MigrateAggregate(aggregate *libdomain.AggregateDefinition) error
- func (c *Driver) NewWorkflow(name string, idempotencyKey string, serializedArgs []byte) (string, error)
- func (c *Driver) OnActivitySuccess(workflowUUID string, step int, serializedResult []byte) error
- func (c *Driver) OnWorkflowError(name string) error
- func (c *Driver) OnWorkflowSuccess(name string, serializedResult []byte) error
- func (d *Driver) RegisterEvents(wk libdomain.WorkflowInterface, a libdomain.AggregateInterface, ...) error
- func (c *Driver) RollbackOrchestratorTransaction(tx interface{})
- func (d *Driver) RollbackTransaction(wk *libapplication.Workflow) error
- func (c *Driver) SearchActivity(workflowUUID string, step int) ([]byte, error)
- func (c *Driver) SearchWorkflow(idempotencyKey string) (string, error)
- func (d *Driver) Select(model libdomain.TableInterface, wk *libapplication.Workflow, ...) (interface{}, error)
- func (d *Driver) SupportTransaction() bool
- func (d *Driver) Update(t libdomain.TableInterface, wk *libapplication.Workflow, ...) (interface{}, error)
- type InsertActivity
- func (a *InsertActivity) MarshalArgs() ([]byte, error)
- func (a *InsertActivity) MarshalResult(result interface{}) ([]byte, error)
- func (a *InsertActivity) Run(ctx context.Context) (interface{}, error)
- func (a *InsertActivity) UnmarshalArgs(data []byte) error
- func (a *InsertActivity) UnmarshalResult(data []byte, resultInterface interface{}) error
- type Store
- type Tx
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientInfo ¶
type ClientInfo struct {
URL string
}
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver contains all the function needed to be recognized as a libdata driver
func NewClient ¶
func NewClient(info *ClientInfo) (*Driver, error)
func (*Driver) BeginTransaction ¶
func (d *Driver) BeginTransaction( wf *libapplication.Workflow, useCache bool, ) error
BeginTransaction will create a new transaction and return it.
func (*Driver) CheckIDExist ¶
func (d *Driver) CheckIDExist( model *libdomain.EntityDefinition, wk *libapplication.Workflow, id string, ) error
func (*Driver) CommitOrchestratorTransaction ¶
func (c *Driver) CommitOrchestratorTransaction(tx interface{})
func (*Driver) CommitTransaction ¶
func (d *Driver) CommitTransaction(wk *libapplication.Workflow) error
CommitTransaction will definitely save all the operations in the transaction.
func (*Driver) CreateTenant ¶
func (d *Driver) CreateTenant(wk *libdata.Workflow, models []*libdata.ModelDefinition, tenant *libdata.Tenant) error
CreateTenant will create the tenant in postgres, either a new schema or a new tenant record
func (*Driver) Delete ¶
func (d *Driver) Delete( model libdomain.TableInterface, wk *libapplication.Workflow, filters []*basepb.Where, ) error
Delete will delete the filtered records.
func (*Driver) GenerateScanFunc ¶
func (d *Driver) GenerateScanFunc(table libdomain.TableInterface) string
func (*Driver) Get ¶
func (d *Driver) Get( t *libdomain.EntityDefinition, wk *libapplication.Workflow, id string, ) (interface{}, error)
Select will return the filtered records.
func (*Driver) GetAggregateEvents ¶
func (d *Driver) GetAggregateEvents( wk libdomain.WorkflowInterface, a libdomain.AggregateInterface, id string, ) ([]*libdomain.Event, error)
func (*Driver) GetConnection ¶
func (*Driver) GetImportRepository ¶
func (*Driver) GetOrchestratorTransaction ¶
func (c *Driver) GetOrchestratorTransaction() interface{}
func (*Driver) GetTenant ¶
func (d *Driver) GetTenant( wk *libdata.Workflow, tenant *libdata.Tenant, ) (*libdata.Tenant, error)
GetTenant will return the tenant.
func (*Driver) GetWorker ¶
func (c *Driver) GetWorker(taskQueue interface{}, options interface{}) libdata.WorkerInterface
func (*Driver) GetWorkflow ¶
func (*Driver) InitDB ¶
func (d *Driver) InitDB( writeInfo *libdata.ClusterInfo, readInfo *libdata.ClusterInfo, ) (*libdata.Cluster, error)
InitDB will connect to the postgres database and return the connection
func (*Driver) Insert ¶
func (d *Driver) Insert( t libdomain.TableInterface, wk *libapplication.Workflow, records []interface{}, insertBuildArgs func([]interface{}) ([]string, map[string]interface{}), ) (interface{}, error)
Insert will insert the new record in the database.
func (*Driver) MarkDispatchedEvent ¶
func (*Driver) MigrateAggregate ¶
func (d *Driver) MigrateAggregate( aggregate *libdomain.AggregateDefinition, ) error
nolint: gocyclo
func (*Driver) NewWorkflow ¶
func (*Driver) OnActivitySuccess ¶
func (*Driver) OnWorkflowError ¶
func (*Driver) OnWorkflowSuccess ¶
func (*Driver) RegisterEvents ¶
func (d *Driver) RegisterEvents( wk libdomain.WorkflowInterface, a libdomain.AggregateInterface, events []*libdomain.Event) error
RegisterEvent will register the event in the event model.
func (*Driver) RollbackOrchestratorTransaction ¶
func (c *Driver) RollbackOrchestratorTransaction(tx interface{})
func (*Driver) RollbackTransaction ¶
func (d *Driver) RollbackTransaction(wk *libapplication.Workflow) error
RollbackTransaction will cancel all the operations in the transaction.
func (*Driver) SearchActivity ¶
func (*Driver) SearchWorkflow ¶
func (*Driver) Select ¶
func (d *Driver) Select( model libdomain.TableInterface, wk *libapplication.Workflow, query *basepb.ListQuery, ) (interface{}, error)
Select will return the filtered records.
func (*Driver) SupportTransaction ¶
func (*Driver) Update ¶
func (d *Driver) Update( t libdomain.TableInterface, wk *libapplication.Workflow, filters []*basepb.Where, record interface{}, updateMask *fieldmask.FieldMask, updateBuildArgs func(interface{}, *fieldmask.FieldMask) ([]string, map[string]interface{}), ) (interface{}, error)
Update will update the data in the filtered records.
type InsertActivity ¶
type InsertActivity struct { Workflow *libapplication.Workflow Query string Args map[string]interface{} }
func (*InsertActivity) MarshalArgs ¶
func (a *InsertActivity) MarshalArgs() ([]byte, error)
func (*InsertActivity) MarshalResult ¶
func (a *InsertActivity) MarshalResult(result interface{}) ([]byte, error)
func (*InsertActivity) Run ¶
func (a *InsertActivity) Run( ctx context.Context, ) (interface{}, error)
func (*InsertActivity) UnmarshalArgs ¶
func (a *InsertActivity) UnmarshalArgs(data []byte) error
func (*InsertActivity) UnmarshalResult ¶
func (a *InsertActivity) UnmarshalResult(data []byte, resultInterface interface{}) error
type Store ¶
type Store interface { InsertBuildArgs([]libdata.ModelInterface) ([]string, map[string]interface{}) UpdateBuildArgs(interface{}, *fieldmask.FieldMask) ([]string, map[string]interface{}) }
Store is an interface containing the functions needed to build the arguments specifics to the model type.