Documentation ¶
Index ¶
- Constants
- func ProcessDelete(db *sql.Connection, code string) (err error)
- func ProcessGet(db *sql.Connection, p *ProcessGetParam) (pList []*model.Process, count int, err error)
- func ProcessGetByCode(db *sql.Connection, code string) (p *model.Process, err error)
- func ProcessGetByID(db *sql.Connection, id int) (p *model.Process, err error)
- func ProcessLock(db *sql.Connection, id int) (p *model.Process, err error)
- func ProcessRunComplete(db *sql.Connection, id int, msg string, runTime time.Duration) (err error)
- func ProcessRunCreate(db *sql.Connection, processID int) (pr *model.ProcessRun, err error)
- func ProcessRunDelete(db *sql.Connection, id int, msg string) (err error)
- func ProcessRunFail(db *sql.Connection, id int, msg string, runTime time.Duration) (err error)
- func ProcessRunGet(db *sql.Connection, p *ProcessRunGetParam) (dList []*model.ProcessRun, count int, err error)
- func ProcessSetInterval(db *sql.Connection, id int, interval time.Duration) (err error)
- func ProcessSetLastSuccess(db *sql.Connection, id int, runTime time.Duration) (err error)
- func ProcessSetRunTime(db *sql.Connection, id int) (err error)
- func ProcessSetStatusByCode(db *sql.Connection, code, status string) (err error)
- func ProcessUpsert(db *sql.Connection, p *model.Process) (id int, err error)
- type ProcessGetParam
- type ProcessRunGetParam
Constants ¶
const ( // ProcessTable ProcessTable = "process" ECode030201 = e.Code0302 + "01" ECode030202 = e.Code0302 + "02" ECode030203 = e.Code0302 + "03" ECode030204 = e.Code0302 + "04" ECode030205 = e.Code0302 + "05" ECode030206_getByCode_notFound = e.Code0302 + "06" ECode030207 = e.Code0302 + "07" ECode030208 = e.Code0302 + "08" ECode030209 = e.Code0302 + "09" ECode03020A = e.Code0302 + "0A" ECode03020B = e.Code0302 + "0B" ECode03020C = e.Code0302 + "0C" ECode03020D = e.Code0302 + "0D" ECode03020E = e.Code0302 + "0E" ECode03020F_lock_alreadyRunning = e.Code0302 + "0F" ECode03020G_lock_statusInactive = e.Code0302 + "0G" ECode03020H_lock_notReady = e.Code0302 + "0H" )
Variables ¶
This section is empty.
Functions ¶
func ProcessDelete ¶
func ProcessDelete(db *sql.Connection, code string) (err error)
ProcessDelete permanently removes the specified record from the process table
func ProcessGet ¶
func ProcessGet(db *sql.Connection, p *ProcessGetParam) (pList []*model.Process, count int, err error)
ProcessGet fetches records from db
func ProcessGetByCode ¶
ProcessGetByCode returns the process record with the specified code
func ProcessGetByID ¶
ProcessGetByID returns the process record with the specified id
func ProcessLock ¶
ProcessLock attempts to establish a lock on the specified process. The process will be skipped in the following scenarios: 1. The process is already running (the row is already locked) 2. The process is no longer active 3. The process has an interval and it is not currently past the process's next run time
func ProcessRunComplete ¶
ProcessRunComplete marks record as completed
func ProcessRunCreate ¶
func ProcessRunCreate(db *sql.Connection, processID int) (pr *model.ProcessRun, err error)
ProcessRunCreate inserts a new record
func ProcessRunDelete ¶
func ProcessRunDelete(db *sql.Connection, id int, msg string) (err error)
ProcessRunDelete deletes record
func ProcessRunFail ¶
ProcessRunFail marks record as failed
func ProcessRunGet ¶
func ProcessRunGet(db *sql.Connection, p *ProcessRunGetParam) (dList []*model.ProcessRun, count int, err error)
ProcessRunGet performs the DB query to return the list of docks
func ProcessSetInterval ¶
ProcessSetInterval update the interval for the process. Will also set the next run time based on the last run time (or now if it does not have a last run time) and the new interval
func ProcessSetLastSuccess ¶
ProcessSetLastSuccess sets the process's last successful run time as now and updates the process success statistics, which include:
- The total number of successful runs
- The average run time
func ProcessSetRunTime ¶
func ProcessSetRunTime(db *sql.Connection, id int) (err error)
ProcessSetRunTime sets the process's last run time as now and the next run time based on the interval
func ProcessSetStatusByCode ¶
func ProcessSetStatusByCode(db *sql.Connection, code, status string) (err error)
ProcessUpdate updates the specified dock record
func ProcessUpsert ¶
ProcessUpsert upsert a record into the process table