Documentation
¶
Index ¶
- func IsErrNotFound(err error) bool
- type ErrNotFound
- type ExecutionDB
- type ExecutionTransaction
- type InstanceDB
- type LevelDBExecutionDB
- type LevelDBExecutionTransaction
- type LevelDBInstanceDB
- func (d *LevelDBInstanceDB) Close() error
- func (d *LevelDBInstanceDB) Delete(hash hash.Hash) error
- func (d *LevelDBInstanceDB) Get(hash hash.Hash) (*instance.Instance, error)
- func (d *LevelDBInstanceDB) GetAll() ([]*instance.Instance, error)
- func (d *LevelDBInstanceDB) Save(i *instance.Instance) error
- type LevelDBServiceDB
- type LevelDBWorkflowDB
- type ServiceDB
- type WorkflowDB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsErrNotFound ¶
IsErrNotFound returns true if err is type of ErrNotFound, false otherwise.
Types ¶
type ErrNotFound ¶
type ErrNotFound struct {
// contains filtered or unexported fields
}
ErrNotFound is an not found error.
func (*ErrNotFound) Error ¶
func (e *ErrNotFound) Error() string
type ExecutionDB ¶ added in v0.4.0
type ExecutionDB interface {
Find(executionHash hash.Hash) (*execution.Execution, error)
Save(execution *execution.Execution) error
OpenTransaction() (ExecutionTransaction, error)
io.Closer
}
ExecutionDB exposes all the functionalities
type ExecutionTransaction ¶ added in v0.11.0
type ExecutionTransaction interface {
Find(executionHash hash.Hash) (*execution.Execution, error)
Save(execution *execution.Execution) error
Commit() error
Discard()
}
ExecutionTransaction is the transaction handle.
type InstanceDB ¶ added in v0.11.0
type InstanceDB interface {
// Get retrives instance by instance hash.
Get(hash hash.Hash) (*instance.Instance, error)
// GetAll retrieves all instances.
GetAll() ([]*instance.Instance, error)
// Save saves instance to database.
Save(i *instance.Instance) error
// Delete an instance by instance hash.
Delete(hash hash.Hash) error
// Close closes underlying database connection.
Close() error
}
InstanceDB describes the API of Instance database.
type LevelDBExecutionDB ¶ added in v0.4.0
type LevelDBExecutionDB struct {
// contains filtered or unexported fields
}
LevelDBExecutionDB is a concrete implementation of the DB interface
func NewExecutionDB ¶ added in v0.4.0
func NewExecutionDB(path string) (*LevelDBExecutionDB, error)
NewExecutionDB creates a new DB instance
func (*LevelDBExecutionDB) Close ¶ added in v0.4.0
func (db *LevelDBExecutionDB) Close() error
Close closes database.
func (*LevelDBExecutionDB) Find ¶ added in v0.4.0
Find the execution based on an executionHash, returns an error if not found
func (*LevelDBExecutionDB) OpenTransaction ¶ added in v0.11.0
func (db *LevelDBExecutionDB) OpenTransaction() (ExecutionTransaction, error)
OpenTransaction opens an atomic DB transaction. Only one transaction can be opened at a time.
type LevelDBExecutionTransaction ¶ added in v0.11.0
type LevelDBExecutionTransaction struct {
// contains filtered or unexported fields
}
LevelDBExecutionTransaction is the transaction handle.
func (*LevelDBExecutionTransaction) Commit ¶ added in v0.11.0
func (tx *LevelDBExecutionTransaction) Commit() error
Commit commits the transaction.
func (*LevelDBExecutionTransaction) Discard ¶ added in v0.11.0
func (tx *LevelDBExecutionTransaction) Discard()
Discard discards the transaction.
type LevelDBInstanceDB ¶ added in v0.11.0
type LevelDBInstanceDB struct {
// contains filtered or unexported fields
}
LevelDBInstanceDB is a database for storing services' instances.
func NewInstanceDB ¶ added in v0.11.0
func NewInstanceDB(path string) (*LevelDBInstanceDB, error)
NewInstanceDB returns the database which is located under given path.
func (*LevelDBInstanceDB) Close ¶ added in v0.11.0
func (d *LevelDBInstanceDB) Close() error
Close closes database.
func (*LevelDBInstanceDB) Delete ¶ added in v0.11.0
func (d *LevelDBInstanceDB) Delete(hash hash.Hash) error
Delete deletes an instance from database.
type LevelDBServiceDB ¶ added in v0.4.0
type LevelDBServiceDB struct {
// contains filtered or unexported fields
}
LevelDBServiceDB is a database for storing service definition.
func NewServiceDB ¶
func NewServiceDB(path string) (*LevelDBServiceDB, error)
NewServiceDB returns the database which is located under given path.
func (*LevelDBServiceDB) All ¶ added in v0.4.0
func (d *LevelDBServiceDB) All() ([]*service.Service, error)
All returns every service in database.
func (*LevelDBServiceDB) Close ¶ added in v0.4.0
func (d *LevelDBServiceDB) Close() error
Close closes database.
func (*LevelDBServiceDB) Delete ¶ added in v0.4.0
func (d *LevelDBServiceDB) Delete(hash hash.Hash) error
Delete deletes service from database.
type LevelDBWorkflowDB ¶ added in v0.13.0
type LevelDBWorkflowDB struct {
// contains filtered or unexported fields
}
LevelDBWorkflowDB is a database for storing workflows definition.
func NewWorkflowDB ¶ added in v0.13.0
func NewWorkflowDB(path string) (*LevelDBWorkflowDB, error)
NewWorkflowDB returns the database which is located under given path.
func (*LevelDBWorkflowDB) All ¶ added in v0.13.0
func (d *LevelDBWorkflowDB) All() ([]*workflow.Workflow, error)
All returns every workflow in database.
func (*LevelDBWorkflowDB) Close ¶ added in v0.13.0
func (d *LevelDBWorkflowDB) Close() error
Close closes database.
func (*LevelDBWorkflowDB) Delete ¶ added in v0.13.0
func (d *LevelDBWorkflowDB) Delete(hash hash.Hash) error
Delete deletes workflow from database.
type ServiceDB ¶
type ServiceDB interface {
// Save saves a service to database.
Save(s *service.Service) error
// Get gets a service from database by its unique hash.
Get(hash hash.Hash) (*service.Service, error)
// Delete deletes a service from database by its unique hash.
Delete(hash hash.Hash) error
// All returns all services from database.
All() ([]*service.Service, error)
// Close closes underlying database connection.
Close() error
}
ServiceDB describes the API of database package.
type WorkflowDB ¶ added in v0.13.0
type WorkflowDB interface {
// Save saves a workflow to database.
Save(s *workflow.Workflow) error
// Get gets a workflow from database by its unique hash.
Get(hash hash.Hash) (*workflow.Workflow, error)
// Delete deletes a workflow from database by its unique hash.
Delete(hash hash.Hash) error
// All returns all workflows from database.
All() ([]*workflow.Workflow, error)
// Close closes underlying database connection.
Close() error
}
WorkflowDB describes the API of database package.