Documentation ¶
Index ¶
- func ConnectDB(lg log.Logger) *sql.DB
- func CreateTemplate(ctx context.Context, db *sql.DB, name string, data []byte, id uuid.UUID) error
- func CreateWorkflow(ctx context.Context, db *sql.DB, wf Workflow, data string, id uuid.UUID) error
- func DeleteFromDB(ctx context.Context, db *sql.DB, id string) error
- func DeleteFromTargetDB(ctx context.Context, db *sql.DB, id string) error
- func DeleteTemplate(ctx context.Context, db *sql.DB, name string) error
- func DeleteWorkflow(ctx context.Context, db *sql.DB, id string, state int32) error
- func Error(err error) *pq.Error
- func GetAll(db *sql.DB, fn func(string) error) error
- func GetByID(ctx context.Context, db *sql.DB, id string) (string, error)
- func GetByIP(ctx context.Context, db *sql.DB, ip string) (string, error)
- func GetByMAC(ctx context.Context, db *sql.DB, mac string) (string, error)
- func GetTemplate(ctx context.Context, db *sql.DB, id string) ([]byte, error)
- func GetWorkflowActions(ctx context.Context, db *sql.DB, wfID string) (*pb.WorkflowActionList, error)
- func GetWorkflowContexts(ctx context.Context, db *sql.DB, wfID string) (*pb.WorkflowContext, error)
- func GetWorkflowDataVersion(ctx context.Context, db *sql.DB, workflowID string) (int32, error)
- func GetWorkflowMetadata(ctx context.Context, db *sql.DB, req *pb.GetWorkflowDataRequest) ([]byte, error)
- func GetfromWfDataTable(ctx context.Context, db *sql.DB, req *pb.GetWorkflowDataRequest) ([]byte, error)
- func GetfromWfWorkflowTable(ctx context.Context, db *sql.DB, id string) ([]string, error)
- func InsertIntoDB(ctx context.Context, db *sql.DB, data string) error
- func InsertIntoTargetDB(ctx context.Context, db *sql.DB, data string, uuid string) error
- func InsertIntoWfDataTable(ctx context.Context, db *sql.DB, req *pb.UpdateWorkflowDataRequest) error
- func InsertIntoWorkflowEventTable(ctx context.Context, db *sql.DB, wfEvent *pb.WorkflowActionStatus, ...) error
- func ListTargets(db *sql.DB, fn func(id, n string) error) error
- func ListTemplates(db *sql.DB, fn func(id, n string, in, del *timestamp.Timestamp) error) error
- func ListWorkflows(db *sql.DB, fn func(wf Workflow) error) error
- func ShowWorkflowEvents(db *sql.DB, wfID string, fn func(wfs pb.WorkflowActionStatus) error) error
- func TargetsByID(ctx context.Context, db *sql.DB, id string) (string, error)
- func UpdateTemplate(ctx context.Context, db *sql.DB, name string, data []byte, id uuid.UUID) error
- func UpdateWorkflow(ctx context.Context, db *sql.DB, wf Workflow, state int32) error
- func UpdateWorkflowState(ctx context.Context, db *sql.DB, wfContext *pb.WorkflowContext) error
- type Workflow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTemplate ¶
CreateTemplate creates a new workflow template
func CreateWorkflow ¶
CreateWorkflow creates a new workflow
func DeleteFromDB ¶
DeleteFromDB : delete data from hardware table
func DeleteFromTargetDB ¶
DeleteFromTargetDB : Delete the targets which belong to the input id
func DeleteTemplate ¶
DeleteTemplate deletes a workflow template
func DeleteWorkflow ¶
DeleteWorkflow deletes a workflow
func GetTemplate ¶
GetTemplate returns a workflow template
func GetWorkflowActions ¶
func GetWorkflowActions(ctx context.Context, db *sql.DB, wfID string) (*pb.WorkflowActionList, error)
GetWorkflowActions : gives you the action list of workflow
func GetWorkflowContexts ¶
GetWorkflowContexts : gives you the current workflow context
func GetWorkflowDataVersion ¶
GetWorkflowDataVersion returns the latest version of data for a workflow
func GetWorkflowMetadata ¶
func GetWorkflowMetadata(ctx context.Context, db *sql.DB, req *pb.GetWorkflowDataRequest) ([]byte, error)
GetWorkflowMetadata returns metadata wrt to the ephemeral data of a workflow
func GetfromWfDataTable ¶
func GetfromWfDataTable(ctx context.Context, db *sql.DB, req *pb.GetWorkflowDataRequest) ([]byte, error)
GetfromWfDataTable : Give you the ephemeral data from workflow_data table
func GetfromWfWorkflowTable ¶
GetfromWfWorkflowTable : gives you the current workflow
func InsertIntoDB ¶
InsertIntoDB : insert data into hardware table
func InsertIntoTargetDB ¶
InsertIntoTargetDB : Push targets data in target table
func InsertIntoWfDataTable ¶
func InsertIntoWfDataTable(ctx context.Context, db *sql.DB, req *pb.UpdateWorkflowDataRequest) error
InsertIntoWfDataTable : Insert ephemeral data in workflow_data table
func InsertIntoWorkflowEventTable ¶
func InsertIntoWorkflowEventTable(ctx context.Context, db *sql.DB, wfEvent *pb.WorkflowActionStatus, time time.Time) error
InsertIntoWorkflowEventTable : insert workflow event table
func ListTargets ¶
ListTargets returns all saved targets which are not deleted
func ListTemplates ¶
ListTemplates returns all saved templates
func ListWorkflows ¶
ListWorkflows returns all workflows
func ShowWorkflowEvents ¶
ShowWorkflowEvents returns all workflows
func TargetsByID ¶
TargetsByID : Get the targets data which belongs to the input id
func UpdateTemplate ¶
UpdateTemplate update a given template
func UpdateWorkflow ¶
UpdateWorkflow updates a given workflow
func UpdateWorkflowState ¶
UpdateWorkflowState : update the current workflow state