Documentation ¶
Index ¶
- func Error(err error) *pq.Error
- type Database
- type TinkDB
- func (d *TinkDB) CheckRequiredMigrations() (int, error)
- func (d TinkDB) CreateTemplate(ctx context.Context, name string, data string, id uuid.UUID) error
- func (d TinkDB) CreateWorkflow(ctx context.Context, wf Workflow, data string, id uuid.UUID) error
- func (d TinkDB) DeleteFromDB(ctx context.Context, id string) error
- func (d TinkDB) DeleteTemplate(ctx context.Context, id string) error
- func (d TinkDB) DeleteWorkflow(ctx context.Context, id string, _ int32) error
- func (d TinkDB) GetAll(fn func([]byte) error) error
- func (d TinkDB) GetByID(ctx context.Context, id string) (string, error)
- func (d TinkDB) GetByIP(ctx context.Context, ip string) (string, error)
- func (d TinkDB) GetByMAC(ctx context.Context, mac string) (string, error)
- func (d TinkDB) GetTemplate(ctx context.Context, fields map[string]string, deleted bool) (*tb.WorkflowTemplate, error)
- func (d TinkDB) GetWorkflow(ctx context.Context, id string) (Workflow, error)
- func (d TinkDB) GetWorkflowActions(ctx context.Context, wfID string) (*pb.WorkflowActionList, error)
- func (d TinkDB) GetWorkflowContexts(ctx context.Context, wfID string) (*pb.WorkflowContext, error)
- func (d TinkDB) GetWorkflowDataVersion(ctx context.Context, workflowID string) (int32, error)
- func (d TinkDB) GetWorkflowMetadata(ctx context.Context, req *pb.GetWorkflowDataRequest) ([]byte, error)
- func (d TinkDB) GetWorkflowsForWorker(ctx context.Context, id string) ([]string, error)
- func (d TinkDB) GetfromWfDataTable(ctx context.Context, req *pb.GetWorkflowDataRequest) ([]byte, error)
- func (d TinkDB) InsertIntoDB(ctx context.Context, data string) error
- func (d TinkDB) InsertIntoWfDataTable(ctx context.Context, req *pb.UpdateWorkflowDataRequest) error
- func (d TinkDB) InsertIntoWorkflowEventTable(ctx context.Context, wfEvent *pb.WorkflowActionStatus, t time.Time) error
- func (d TinkDB) ListTemplates(filter string, fn func(id, n string, in, del *timestamp.Timestamp) error) error
- func (d TinkDB) ListWorkflows(fn func(wf Workflow) error) error
- func (d *TinkDB) Migrate() (int, error)
- func (d TinkDB) ShowWorkflowEvents(wfID string, fn func(wfs *pb.WorkflowActionStatus) error) error
- func (d TinkDB) UpdateTemplate(ctx context.Context, name string, data string, id uuid.UUID) error
- func (d TinkDB) UpdateWorkflow(ctx context.Context, wf Workflow, _ int32) error
- func (d TinkDB) UpdateWorkflowState(ctx context.Context, wfContext *pb.WorkflowContext) error
- type WorkerWorkflow
- type Workflow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Database ¶
type Database interface { WorkerWorkflow // contains filtered or unexported methods }
Database interface for tinkerbell database operations.
type TinkDB ¶
type TinkDB struct {
// contains filtered or unexported fields
}
TinkDB implements the Database interface.
func (*TinkDB) CheckRequiredMigrations ¶ added in v0.2.0
func (TinkDB) CreateTemplate ¶
CreateTemplate creates a new workflow template.
func (TinkDB) CreateWorkflow ¶
CreateWorkflow creates a new workflow.
func (TinkDB) DeleteFromDB ¶
DeleteFromDB : delete data from hardware table.
func (TinkDB) DeleteTemplate ¶
DeleteTemplate deletes a workflow template by id.
func (TinkDB) DeleteWorkflow ¶
DeleteWorkflow deletes a workflow.
func (TinkDB) GetTemplate ¶
func (d TinkDB) GetTemplate(ctx context.Context, fields map[string]string, deleted bool) (*tb.WorkflowTemplate, error)
GetTemplate returns template which is not deleted.
func (TinkDB) GetWorkflow ¶
GetWorkflow returns a workflow.
func (TinkDB) GetWorkflowActions ¶
func (d TinkDB) GetWorkflowActions(ctx context.Context, wfID string) (*pb.WorkflowActionList, error)
GetWorkflowActions : gives you the action list of workflow.
func (TinkDB) GetWorkflowContexts ¶
GetWorkflowContexts : gives you the current workflow context.
func (TinkDB) GetWorkflowDataVersion ¶
GetWorkflowDataVersion returns the latest version of data for a workflow.
func (TinkDB) GetWorkflowMetadata ¶
func (d TinkDB) GetWorkflowMetadata(ctx context.Context, req *pb.GetWorkflowDataRequest) ([]byte, error)
GetWorkflowMetadata returns metadata wrt to the ephemeral data of a workflow.
func (TinkDB) GetWorkflowsForWorker ¶
GetWorkflowsForWorker : returns the list of workflows for a particular worker.
func (TinkDB) GetfromWfDataTable ¶
func (d TinkDB) GetfromWfDataTable(ctx context.Context, req *pb.GetWorkflowDataRequest) ([]byte, error)
GetfromWfDataTable : Give you the ephemeral data from workflow_data table.
func (TinkDB) InsertIntoDB ¶
InsertIntoDB : insert data into hardware table.
func (TinkDB) InsertIntoWfDataTable ¶
InsertIntoWfDataTable : Insert ephemeral data in workflow_data table.
func (TinkDB) InsertIntoWorkflowEventTable ¶
func (d TinkDB) InsertIntoWorkflowEventTable(ctx context.Context, wfEvent *pb.WorkflowActionStatus, t time.Time) error
InsertIntoWorkflowEventTable : insert workflow event table.
func (TinkDB) ListTemplates ¶
func (d TinkDB) ListTemplates(filter string, fn func(id, n string, in, del *timestamp.Timestamp) error) error
ListTemplates returns all saved templates.
func (TinkDB) ListWorkflows ¶
ListWorkflows returns all workflows.
func (TinkDB) ShowWorkflowEvents ¶
ShowWorkflowEvents returns all workflows.
func (TinkDB) UpdateTemplate ¶
UpdateTemplate update a given template.
func (TinkDB) UpdateWorkflow ¶
UpdateWorkflow updates a given workflow.
func (TinkDB) UpdateWorkflowState ¶
UpdateWorkflowState : update the current workflow state.
type WorkerWorkflow ¶ added in v0.7.0
type WorkerWorkflow interface { InsertIntoWfDataTable(ctx context.Context, req *pb.UpdateWorkflowDataRequest) error GetfromWfDataTable(ctx context.Context, req *pb.GetWorkflowDataRequest) ([]byte, error) GetWorkflowsForWorker(ctx context.Context, id string) ([]string, error) UpdateWorkflowState(ctx context.Context, wfContext *pb.WorkflowContext) error GetWorkflowContexts(ctx context.Context, wfID string) (*pb.WorkflowContext, error) GetWorkflowActions(ctx context.Context, wfID string) (*pb.WorkflowActionList, error) }
WorkerWorkflow is an interface for methods invoked by APIs that the worker calls.