sqldb

package
v2.4.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeInvalidDBSession    = "ERR_INVALID_DB_SESSION"
	CodeDBUpdateRowNotFound = "ERR_DB_UPDATE_ROW_NOT_FOUND"
	CodeDBOperationError    = "ERR_DB_OPERATION_ERROR"
)

Variables

This section is empty.

Functions

func CreateDBSession

func CreateDBSession(kubectlConfig kubernetes.Interface, namespace string, persistConfig *config.PersistConfig) (sqlbuilder.Database, string, error)

CreateDBSession creates the dB session

func CreateMySQLDBSession

func CreateMySQLDBSession(kubectlConfig kubernetes.Interface, namespace string, mysqlConfig *config.MySQLConfig, persistPool *config.ConnectionPool) (sqlbuilder.Database, string, error)

CreatePostGresDBSession creates Mysql DB session

func CreatePostGresDBSession

func CreatePostGresDBSession(kubectlConfig kubernetes.Interface, namespace string, postgresConfig *config.PostgreSQLConfig, persistPool *config.ConnectionPool) (sqlbuilder.Database, string, error)

CreatePostGresDBSession creates postgresDB session

func DBInvalidSession

func DBInvalidSession(err error, message ...string) error

func DBOperationError

func DBOperationError(err error, message ...string) error

func DBUpdateNoRowFoundError

func DBUpdateNoRowFoundError(err error, message ...string) error

func DBUpdateNoRowFoundErrorf

func DBUpdateNoRowFoundErrorf(err error, format string, args ...interface{}) error

InternalWrapErrorf annotates the error with the ERR_INTERNAL code and a stack trace, optional message

Types

type DBRepository

type DBRepository interface {
	Save(wf *wfv1.Workflow) error
	Get(uid string) (*wfv1.Workflow, error)
	List() ([]wfv1.Workflow, error)
	Query(condition interface{}) ([]wfv1.Workflow, error)
	Close() error
	IsNodeStatusOffload() bool
}

type WorkflowDB

type WorkflowDB struct {
	Id         string         `db:"id"`
	Name       string         `db:"name"`
	Phase      wfv1.NodePhase `db:"phase"`
	Namespace  string         `db:"namespace"`
	Workflow   string         `db:"workflow"`
	StartedAt  time.Time      `db:"startedat"`
	FinishedAt time.Time      `db:"finishedat"`
}

type WorkflowDBContext

type WorkflowDBContext struct {
	TableName         string
	NodeStatusOffload bool
	Session           sqlbuilder.Database
}

func (*WorkflowDBContext) Close

func (wdc *WorkflowDBContext) Close() error

func (*WorkflowDBContext) Get

func (wdc *WorkflowDBContext) Get(uid string) (*wfv1.Workflow, error)

func (*WorkflowDBContext) Init

func (wdc *WorkflowDBContext) Init(sess sqlbuilder.Database)

func (*WorkflowDBContext) IsNodeStatusOffload

func (wdc *WorkflowDBContext) IsNodeStatusOffload() bool

func (*WorkflowDBContext) List

func (wdc *WorkflowDBContext) List() ([]wfv1.Workflow, error)

func (*WorkflowDBContext) Query

func (wdc *WorkflowDBContext) Query(condition interface{}) ([]wfv1.Workflow, error)

func (*WorkflowDBContext) Save

func (wdc *WorkflowDBContext) Save(wf *wfv1.Workflow) error

Save will upset the workflow

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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