Documentation ¶
Index ¶
- type DB
- func (d DB) ClearTemplateDB()
- func (d DB) CreateTemplate(ctx 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(ctx context.Context, id string) error
- func (d DB) DeleteTemplate(ctx context.Context, name string) error
- func (d DB) DeleteWorkflow(ctx context.Context, id string, state int32) error
- func (d DB) Events(req *events.WatchRequest, fn func(n informers.Notification) error) error
- func (d DB) GetAll(fn func([]byte) error) error
- func (d DB) GetByID(ctx context.Context, id string) (string, error)
- func (d DB) GetByIP(ctx context.Context, ip string) (string, error)
- func (d DB) GetByMAC(ctx context.Context, mac string) (string, error)
- func (d DB) GetTemplate(ctx context.Context, fields map[string]string, deleted bool) (string, string, string, 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(id string) ([]string, error)
- func (d DB) GetfromWfDataTable(ctx context.Context, req *pb.GetWorkflowDataRequest) ([]byte, error)
- func (d DB) InsertIntoDB(ctx context.Context, data string) error
- func (d DB) InsertIntoWfDataTable(ctx context.Context, req *pb.UpdateWorkflowDataRequest) error
- func (d DB) InsertIntoWorkflowEventTable(ctx context.Context, wfEvent *pb.WorkflowActionStatus, time time.Time) error
- func (d DB) ListTemplates(in string, fn func(id, n string, in, del *timestamp.Timestamp) error) error
- func (d DB) ListWorkflows(fn func(wf db.Workflow) error) error
- func (d DB) ShowWorkflowEvents(wfID string, fn func(wfs *pb.WorkflowActionStatus) error) error
- func (d DB) UpdateTemplate(ctx context.Context, name string, data string, id uuid.UUID) error
- func (d DB) UpdateWorkflow(ctx context.Context, wf db.Workflow, state 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(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) (string, string, string, 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) Events ¶ added in v0.3.0
func (d DB) Events(req *events.WatchRequest, fn func(n informers.Notification) error) error
Events fetches events for a given time frame, and sends them to over the stream
func (DB) GetTemplate ¶
func (d DB) GetTemplate(ctx context.Context, fields map[string]string, deleted bool) (string, string, string, 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, time time.Time) error
InsertIntoWorkflowEventTable : insert workflow event table
func (DB) ListTemplates ¶
func (d DB) ListTemplates(in string, fn func(id, n string, in, del *timestamp.Timestamp) error) error
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