Documentation ¶
Index ¶
- Variables
- type ClientInfo
- type DBRequestError
- type DBUnrecognizedOperatorError
- type Driver
- func (d *Driver) BeginTransaction(wf *libapplication.ApplicationContext, useCache bool) error
- func (c *Driver) Close()
- func (c *Driver) CommitOrchestratorTransaction(tx interface{})
- func (d *Driver) CommitTransaction(wk *libapplication.ApplicationContext) error
- func (d *Driver) Delete(model libpersistence.TableInterface, wk *libapplication.ApplicationContext, ...) error
- func (d *Driver) GenerateInsertBuildArgsFunc(datasourceClient libpersistence.DatasourceClient, ...) string
- func (d *Driver) GenerateScanFunc(datasourceClient libpersistence.DatasourceClient, prefix string, ...) string
- func (d *Driver) GenerateSchema(tables []*libpersistence.TableDefinition) string
- func (d *Driver) Get(t *libpersistence.TableDefinition, wk *libapplication.ApplicationContext, ...) (interface{}, error)
- func (d *Driver) GetAggregateEvents(wk *libapplication.ApplicationContext, a *libdomain.AggregateDefinition, ...) ([]*libapplication.Event, error)
- func (d *Driver) GetAggregateHistory(wk *libapplication.ApplicationContext, a *libdomain.AggregateDefinition, ...) ([]*libdomain.EventHistory, error)
- func (d *Driver) GetConnection() *sqlx.DB
- func (d *Driver) GetDriverName() string
- func (d *Driver) GetImportRepository() string
- func (c *Driver) GetOrchestratorTransaction() interface{}
- func (d *Driver) GetScanType() string
- func (c *Driver) GetWorkflow(id string) (string, string, []byte, []byte, error)
- func (d *Driver) Insert(t libpersistence.TableInterface, wk *libapplication.ApplicationContext, ...) (interface{}, error)
- func (d *Driver) InsertDefault(t libpersistence.TableInterface, wk *libapplication.ApplicationContext, ...) (interface{}, error)
- func (d *Driver) MarkDispatchedEvent(wk *libapplication.ApplicationContext, event *libapplication.Event) error
- func (d *Driver) MigrateTables(tables map[*libpersistence.TableDefinition]*libpersistence.TableDefinition, ...) 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 *libapplication.ApplicationContext, a interface{}, ...) error
- func (c *Driver) RollbackOrchestratorTransaction(tx interface{})
- func (d *Driver) RollbackTransaction(wk *libapplication.ApplicationContext) error
- func (c *Driver) SearchActivity(workflowUUID string, step int) ([]byte, error)
- func (c *Driver) SearchWorkflow(idempotencyKey string) (string, error)
- func (d *Driver) Select(model libpersistence.TableInterface, wk *libapplication.ApplicationContext, ...) (interface{}, error)
- func (d *Driver) SupportTransaction() bool
- func (d *Driver) Update(t libpersistence.TableInterface, wk *libapplication.ApplicationContext, ...) (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 Tx
Constants ¶
This section is empty.
Variables ¶
var EventDefinition = &libpersistence.TableDefinition{ Name: "event", Properties: []libpersistence.Property{ properties.Many2one("tenantID", false, "", nil, libdomain.OnDeleteCascade, false, 3, 4, nil, nil), properties.Text("aggregate", true, 3, 4, nil, nil), properties.Many2one("aggregateID", true, "", nil, libdomain.OnDeleteSetNull, false, 3, 4, nil, nil), properties.Integer("aggregateVersion", true, 3, 4, nil, nil), properties.Text("event", true, 3, 4, nil, nil), properties.Integer("eventVersion", true, 3, 4, nil, nil), properties.Text("diff", true, 3, 4, nil, nil), properties.Text("payload", true, 3, 4, nil, nil), properties.Boolean("dispatched", true, 3, 4, nil, nil), properties.Datetime("occurredAt", true, 3, 4, nil, nil), properties.Many2one("occurredBy", false, "", nil, libdomain.OnDeleteSetNull, false, 3, 4, nil, nil), }, }
Functions ¶
This section is empty.
Types ¶
type ClientInfo ¶
type ClientInfo struct {
URL string
}
type DBRequestError ¶
DBRequestError is an error returned when the database return an error.
func (*DBRequestError) Error ¶
func (e *DBRequestError) Error() string
Error return the error message.
type DBUnrecognizedOperatorError ¶
type DBUnrecognizedOperatorError struct {
O string
}
DBUnrecognizedOperatorError is an error returned when you use a non existing operator in filter.
func (*DBUnrecognizedOperatorError) Error ¶
func (e *DBUnrecognizedOperatorError) Error() string
Error return the error message.
type Driver ¶
type Driver struct { InsertCustom func( *Driver, libpersistence.TableInterface, *libapplication.ApplicationContext, []interface{}, []string, map[string]interface{}, []string, ) (interface{}, error) // 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.ApplicationContext, useCache bool, ) error
BeginTransaction will create a new transaction and return it.
func (*Driver) CommitOrchestratorTransaction ¶
func (c *Driver) CommitOrchestratorTransaction(tx interface{})
func (*Driver) CommitTransaction ¶
func (d *Driver) CommitTransaction(wk *libapplication.ApplicationContext) error
CommitTransaction will definitely save all the operations in the transaction.
func (*Driver) Delete ¶
func (d *Driver) Delete( model libpersistence.TableInterface, wk *libapplication.ApplicationContext, filters []*libpersistence.Filter, ) error
Delete will delete the filtered records.
func (*Driver) GenerateInsertBuildArgsFunc ¶
func (d *Driver) GenerateInsertBuildArgsFunc(datasourceClient libpersistence.DatasourceClient, table libpersistence.TableInterface) string
func (*Driver) GenerateScanFunc ¶
func (d *Driver) GenerateScanFunc(datasourceClient libpersistence.DatasourceClient, prefix string, table libpersistence.TableInterface) string
func (*Driver) GenerateSchema ¶
func (d *Driver) GenerateSchema( tables []*libpersistence.TableDefinition, ) string
func (*Driver) Get ¶
func (d *Driver) Get( t *libpersistence.TableDefinition, wk *libapplication.ApplicationContext, id string, ) (interface{}, error)
Select will return the filtered records.
func (*Driver) GetAggregateEvents ¶
func (d *Driver) GetAggregateEvents( wk *libapplication.ApplicationContext, a *libdomain.AggregateDefinition, id string, ) ([]*libapplication.Event, error)
func (*Driver) GetAggregateHistory ¶
func (d *Driver) GetAggregateHistory( wk *libapplication.ApplicationContext, a *libdomain.AggregateDefinition, id string, ) ([]*libdomain.EventHistory, error)
func (*Driver) GetConnection ¶
func (*Driver) GetDriverName ¶
func (*Driver) GetImportRepository ¶
func (*Driver) GetOrchestratorTransaction ¶
func (c *Driver) GetOrchestratorTransaction() interface{}
func (*Driver) GetScanType ¶
func (*Driver) GetWorkflow ¶
func (*Driver) Insert ¶
func (d *Driver) Insert( t libpersistence.TableInterface, wk *libapplication.ApplicationContext, records []interface{}, fields []string, args map[string]interface{}, properties []string, ) (interface{}, error)
func (*Driver) InsertDefault ¶
func (d *Driver) InsertDefault( t libpersistence.TableInterface, wk *libapplication.ApplicationContext, records []interface{}, fields []string, args map[string]interface{}, properties []string, ) (interface{}, error)
Insert will insert the new record in the database.
func (*Driver) MarkDispatchedEvent ¶
func (d *Driver) MarkDispatchedEvent( wk *libapplication.ApplicationContext, event *libapplication.Event, ) error
func (*Driver) MigrateTables ¶
func (d *Driver) MigrateTables( tables map[*libpersistence.TableDefinition]*libpersistence.TableDefinition, mainDatasource bool, ) error
nolint: gocyclo
func (*Driver) NewWorkflow ¶
func (*Driver) OnActivitySuccess ¶
func (*Driver) OnWorkflowError ¶
func (*Driver) OnWorkflowSuccess ¶
func (*Driver) RegisterEvents ¶
func (d *Driver) RegisterEvents( wk *libapplication.ApplicationContext, a interface{}, events []*libapplication.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.ApplicationContext) error
RollbackTransaction will cancel all the operations in the transaction.
func (*Driver) SearchActivity ¶
func (*Driver) SearchWorkflow ¶
func (*Driver) Select ¶
func (d *Driver) Select( model libpersistence.TableInterface, wk *libapplication.ApplicationContext, filters []*libpersistence.Filter, properties []string, options *libpersistence.OptionsListQuery, ) (interface{}, error)
Select will return the filtered records.
func (*Driver) SupportTransaction ¶
func (*Driver) Update ¶
func (d *Driver) Update( t libpersistence.TableInterface, wk *libapplication.ApplicationContext, filters []*libpersistence.Filter, record interface{}, set []string, args map[string]interface{}, properties []string, ) (interface{}, error)
Update will update the data in the filtered records.
type InsertActivity ¶
type InsertActivity struct { Workflow *libapplication.ApplicationContext 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