db

package
v0.0.0-...-1927dbb Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidParams defines invalid params error.
	ErrInvalidParams = errors.New("invalid params")
	// ErrSQLExec defines sql execution error.
	ErrSQLExec = errors.New("sql executed fail")
)

Functions

func AddTask

func AddTask(tmplID uint, content, operator, serviceUID, prevState, namespace string, status uint) error

AddTask adds a record into `tasks`.

func AddTaskTmpl

func AddTaskTmpl(name, content, brief, operator string, vars []model.TaskTmplVar, icon string) (t model.TaskTmpl, e error)

AddTaskTmpl adds a record into table `task_tmpls`.

func AddTaskTmplVar

func AddTaskTmplVar(name, title, comment, dataSource string, taskTmplID, formType uint) (t model.TaskTmplVar, e error)

AddTaskTmplVar adds a record into table `task_tmpl_vars`.

func DelTaskTmpl

func DelTaskTmpl(id int) error

DelTaskTmpl deletes specific record of table `task_tmpls`.

func DelTaskTmplVar

func DelTaskTmplVar(id int) error

DelTaskTmplVar deletes specific record of table `task_tmpl_vars`.

func DeleteTask

func DeleteTask(id uint, operator string) error

DeleteTask deletes specific record of `tasks`. Deprecated: the function is already Deprecated.

func GetTask

func GetTask(name, content, operator, serviceUID string, id uint, ctmin, ctmax int, revision uint) []model.Task

GetTask queries records from `tasks` with provided fields.

func GetTaskTmpl

func GetTaskTmpl(name, content, operator string, ids []uint, ctmin, ctmax int, revision, tp uint) []model.TaskTmpl

GetTaskTmpl queries records from table `task_tmpls` with provided conditions.

func GetTaskTmplVar

func GetTaskTmplVar(name, title, comment, dataSource string, formType, tasktmplID uint, ids []uint) []model.TaskTmplVar

GetTaskTmplVar queries records from table `task_tmpl_vars` with provided fields.

func Init

func Init()

Init initializes db pkg.

func UpdateTask

func UpdateTask(content, operator, serviceUID string, id, tmplID, status uint) error

UpdateTask updates specific record of `tasks`. Deprecated: the function is already Deprecated.

func UpdateTaskTmpl

func UpdateTaskTmpl(name, content, brief, operator string, id uint, icon string) error

UpdateTaskTmpl updates specific record of table `task_tmpls`.

func UpdateTaskTmplVar

func UpdateTaskTmplVar(name, title, comment, dataSource string, id, formType uint) error

UpdateTaskTmplVar updates specific record of table `task_tmpl_vars`.

Types

This section is empty.

Jump to

Keyboard shortcuts

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