status

package
v0.0.0-...-97dcd52 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2018 License: AGPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NoopStatusManager

type NoopStatusManager struct{}

NoopStatusManager is a No operation StatusManager

func (*NoopStatusManager) Complete

func (s *NoopStatusManager) Complete(componentName, componentID, jobName, jobID string, stepInfos, message map[string]string) error

Complete with nop implementation

func (*NoopStatusManager) Fail

func (s *NoopStatusManager) Fail(componentName, componentID, jobName, jobID string, stepInfos, message map[string]string) error

Fail with nop implementation

func (*NoopStatusManager) Register

func (s *NoopStatusManager) Register(componentName, componentID, jobName, jobID string)

Register with nop implementation

func (*NoopStatusManager) Start

func (s *NoopStatusManager) Start(componentName, componentID, jobName string) error

Start with nop implementation

func (*NoopStatusManager) Update

func (s *NoopStatusManager) Update(componentName, componentID, jobName string, stepInfos map[string]string) error

Update with nop implementation

type Status

type Status struct {
	// contains filtered or unexported fields
}

Status is the status module.

func New

func New(s Storage) *Status

New returns a new status module.

func NewComponentStatus

func NewComponentStatus(s Storage) *Status

NewComponentStatus returns a new status module with status information that are per component. Two instances of the component will each have a status entry in the DB.

func (*Status) Complete

func (s *Status) Complete(componentName, componentID, jobName, jobID string, stepInfos, message map[string]string) error

Complete update the job infos when the job finishes without errors.

func (*Status) Fail

func (s *Status) Fail(componentName, componentID, jobName, jobID string, stepInfos, message map[string]string) error

Fail update the job infos when the job finishes with errors.

func (*Status) GetStartTime

func (s *Status) GetStartTime(componentName, componentID, jobName string) (time.Time, error)

GetStartTime reads in DB and returns the time at which the job started.

func (*Status) GetStatus

func (s *Status) GetStatus(componentName, componentID, jobName string) (*Table, error)

GetStatus returns the whole status database entry for the current Job.

func (*Status) Register

func (s *Status) Register(componentName, componentID, jobName, jobID string)

Register register the job in the DB.

func (*Status) Start

func (s *Status) Start(componentName, componentID, jobName string) error

Start update the job start time in the DB.

func (*Status) Update

func (s *Status) Update(componentName, componentID, jobName string, stepInfos map[string]string) error

Update updates the job status.

type Storage

type Storage interface {
	Exec(query string, args ...interface{}) (sql.Result, error)
	QueryRow(query string, args ...interface{}) *sql.Row
}

Storage is the interface of the storage.

type Table

type Table struct {
	// contains filtered or unexported fields
}

Table is a struct representing a row of the database status table.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL