Documentation ¶
Index ¶
- func Error(err error) *pq.Error
- type Database
- type TinkDB
- func (t *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, state int32) error
- func (d TinkDB) Events(req *events.WatchRequest, fn func(n informers.Notification) error) 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) (string, string, string, 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(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, time 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 (t *TinkDB) Migrate() (int, error)
- func (t *TinkDB) PurgeEvents(errCh chan<- 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, state int32) error
- func (d TinkDB) UpdateWorkflowState(ctx context.Context, wfContext *pb.WorkflowContext) error
- type Workflow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Database ¶
type Database interface {
// 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) Events ¶ added in v0.3.0
func (d TinkDB) 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 (TinkDB) GetTemplate ¶
func (d TinkDB) GetTemplate(ctx context.Context, fields map[string]string, deleted bool) (string, string, string, 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, time 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) PurgeEvents ¶ added in v0.3.0
PurgeEvents periodically checks the events table and purges the events that have passed the defined EVENTS_TTL.
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