Documentation ¶
Index ¶
- type DB
- func (d *DB) ClearTemplateDB()
- func (d *DB) CreateTemplate(_ context.Context, name string, data string, id uuid.UUID) error
- func (d DB) CreateWorkflow(ctx context.Context, wf db.Workflow, data string, id uuid.UUID) error
- func (d DB) DeleteFromDB(_ context.Context, _ string) error
- func (d DB) DeleteTemplate(_ context.Context, name string) error
- func (d DB) DeleteWorkflow(_ context.Context, _ string, _ int32) error
- func (d DB) GetAll(_ func([]byte) error) error
- func (d DB) GetByID(_ context.Context, _ string) (string, error)
- func (d DB) GetByIP(_ context.Context, _ string) (string, error)
- func (d DB) GetByMAC(_ context.Context, _ string) (string, error)
- func (d DB) GetTemplate(ctx context.Context, fields map[string]string, deleted bool) (*tb.WorkflowTemplate, error)
- func (d DB) GetWorkflow(ctx context.Context, id string) (db.Workflow, error)
- func (d DB) GetWorkflowActions(ctx context.Context, wfID string) (*pb.WorkflowActionList, error)
- func (d DB) GetWorkflowContexts(ctx context.Context, wfID string) (*pb.WorkflowContext, error)
- func (d DB) GetWorkflowDataVersion(ctx context.Context, workflowID string) (int32, error)
- func (d DB) GetWorkflowMetadata(ctx context.Context, req *pb.GetWorkflowDataRequest) ([]byte, error)
- func (d DB) GetWorkflowsForWorker(ctx context.Context, id string) ([]string, error)
- func (d DB) GetfromWfDataTable(ctx context.Context, req *pb.GetWorkflowDataRequest) ([]byte, error)
- func (d DB) InsertIntoDB(_ context.Context, _ string) error
- func (d DB) InsertIntoWfDataTable(ctx context.Context, req *pb.UpdateWorkflowDataRequest) error
- func (d DB) InsertIntoWorkflowEventTable(ctx context.Context, wfEvent *pb.WorkflowActionStatus, t time.Time) error
- func (d DB) ListTemplates(_ string, _ func(id, n string, in, del *timestamp.Timestamp) error) error
- func (d DB) ListWorkflows(_ func(wf db.Workflow) error) error
- func (d DB) ShowWorkflowEvents(_ string, _ func(wfs *pb.WorkflowActionStatus) error) error
- func (d DB) UpdateTemplate(_ context.Context, _ string, _ string, _ uuid.UUID) error
- func (d DB) UpdateWorkflow(_ context.Context, _ db.Workflow, _ int32) error
- func (d DB) UpdateWorkflowState(ctx context.Context, wfContext *pb.WorkflowContext) error
- type Template
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct { // workflow CreateWorkflowFunc func(ctx context.Context, wf db.Workflow, data string, id uuid.UUID) error GetWorkflowFunc func(ctx context.Context, id string) (db.Workflow, error) GetfromWfDataTableFunc func(ctx context.Context, req *pb.GetWorkflowDataRequest) ([]byte, error) InsertIntoWfDataTableFunc func(ctx context.Context, req *pb.UpdateWorkflowDataRequest) error GetWorkflowMetadataFunc func(ctx context.Context, req *pb.GetWorkflowDataRequest) ([]byte, error) GetWorkflowDataVersionFunc func(ctx context.Context, workflowID string) (int32, error) GetWorkflowsForWorkerFunc func(ctx context.Context, id string) ([]string, error) GetWorkflowContextsFunc func(ctx context.Context, wfID string) (*pb.WorkflowContext, error) GetWorkflowActionsFunc func(ctx context.Context, wfID string) (*pb.WorkflowActionList, error) UpdateWorkflowStateFunc func(ctx context.Context, wfContext *pb.WorkflowContext) error InsertIntoWorkflowEventTableFunc func(ctx context.Context, wfEvent *pb.WorkflowActionStatus, time time.Time) error // template TemplateDB map[string]interface{} GetTemplateFunc func(ctx context.Context, fields map[string]string, deleted bool) (*tb.WorkflowTemplate, error) }
DB is the mocked implementation of Database interface.
func (*DB) ClearTemplateDB ¶ added in v0.2.0
func (d *DB) ClearTemplateDB()
ClearTemplateDB clear all the templates.
func (*DB) CreateTemplate ¶
CreateTemplate creates a new workflow template.
func (DB) CreateWorkflow ¶
CreateWorkflow creates a new workflow.
func (DB) DeleteFromDB ¶
DeleteFromDB : delete data from hardware table.
func (DB) DeleteTemplate ¶
DeleteTemplate deletes a workflow template.
func (DB) DeleteWorkflow ¶
DeleteWorkflow deletes a workflow.
func (DB) GetTemplate ¶
func (d DB) GetTemplate(ctx context.Context, fields map[string]string, deleted bool) (*tb.WorkflowTemplate, error)
GetTemplate returns a workflow template.
func (DB) GetWorkflow ¶
GetWorkflow returns a workflow.
func (DB) GetWorkflowActions ¶
GetWorkflowActions : gives you the action list of workflow.
func (DB) GetWorkflowContexts ¶
GetWorkflowContexts : gives you the current workflow context.
func (DB) GetWorkflowDataVersion ¶
GetWorkflowDataVersion returns the latest version of data for a workflow.
func (DB) GetWorkflowMetadata ¶
func (d DB) GetWorkflowMetadata(ctx context.Context, req *pb.GetWorkflowDataRequest) ([]byte, error)
GetWorkflowMetadata returns metadata wrt to the ephemeral data of a workflow.
func (DB) GetWorkflowsForWorker ¶
GetWorkflowsForWorker : returns the list of workflows for a particular worker.
func (DB) GetfromWfDataTable ¶
GetfromWfDataTable : Give you the ephemeral data from workflow_data table.
func (DB) InsertIntoDB ¶
InsertIntoDB : insert data into hardware table.
func (DB) InsertIntoWfDataTable ¶
InsertIntoWfDataTable : Insert ephemeral data in workflow_data table.
func (DB) InsertIntoWorkflowEventTable ¶
func (d DB) InsertIntoWorkflowEventTable(ctx context.Context, wfEvent *pb.WorkflowActionStatus, t time.Time) error
InsertIntoWorkflowEventTable : insert workflow event table.
func (DB) ListTemplates ¶
ListTemplates returns all saved templates.
func (DB) ListWorkflows ¶
ListWorkflows returns all workflows.
func (DB) ShowWorkflowEvents ¶
ShowWorkflowEvents returns all workflows.
func (DB) UpdateTemplate ¶
UpdateTemplate update a given template.
func (DB) UpdateWorkflow ¶
UpdateWorkflow updates a given workflow.
func (DB) UpdateWorkflowState ¶
UpdateWorkflowState : update the current workflow state.