Documentation
¶
Index ¶
- Constants
- Variables
- func Get(ctx *gin.Context)
- func GetConfig(ctx *gin.Context)
- func Page(ctx *gin.Context)
- func Rollback(ctx *gin.Context)
- func SaveConfig(ctx *gin.Context)
- func SetBackupCount(count int)
- func Start(ctx *gin.Context)
- func Stop(ctx *gin.Context)
- type OtherRepo
- type RollbackStatus
- type Status
- type TaskOptions
- type TaskRecord
- type TaskRecordLog
- type TaskRecordLogLevel
Constants ¶
View Source
const DpTaskKey = "dp_task_config"
View Source
const TimeOut = 10 * time.Minute
Variables ¶
View Source
var Task taskService
Functions ¶
func SaveConfig ¶
func SetBackupCount ¶
func SetBackupCount(count int)
Types ¶
type RollbackStatus ¶
type RollbackStatus string
const ( UnReady RollbackStatus = "" Ready RollbackStatus = "ready" Cleaned RollbackStatus = "cleaned" )
type TaskOptions ¶
type TaskOptions struct {
GitInit bool `json:"gitInit" form:"gitInit" binding:"required"`
GoInit bool `json:"goInit" form:"goInit" binding:"required"`
SshKeyCopy bool `json:"sshKeyCopy" form:"sshKeyCopy" binding:"required"`
Repo string `json:"repo" form:"repo" binding:"required"`
Branch string `json:"branch" form:"branch" binding:"required"`
OtherRepos *[]OtherRepo `json:"otherRepos" form:"otherRepos"`
AutoTrigger bool `json:"autoTrigger" form:"autoTrigger"`
}
type TaskRecord ¶
type TaskRecord struct {
Ctx context.Context `json:"-"`
Storage cache.Pager[TaskRecord] `json:"-"`
ID string `json:"id"`
TaskOptions
Commit string `json:"commit"`
GitHash string `json:"gitHash"`
CreateAt time.Time `json:"createAt"`
Status Status `json:"status"`
CreateBy string `json:"createBy"`
BuildFile string `json:"buildFile"`
Log []TaskRecordLog `json:"log"`
StartAt time.Time `json:"startAt"`
FinishAt time.Time `json:"finishAt"`
RBStatus RollbackStatus `json:"rbStatus"`
RB bool `json:"rb"`
RID string `json:"rid"`
}
func (*TaskRecord) Running ¶
func (t *TaskRecord) Running(log string, level ...TaskRecordLogLevel)
func (*TaskRecord) TimeOut ¶ added in v1.0.8
func (t *TaskRecord) TimeOut(log string)
type TaskRecordLog ¶
type TaskRecordLog struct {
Time time.Time `json:"time"`
Text string `json:"text"`
Level TaskRecordLogLevel `json:"level"`
}
type TaskRecordLogLevel ¶
type TaskRecordLogLevel string
const ( Info TaskRecordLogLevel = "info" Warn TaskRecordLogLevel = "warn" Error TaskRecordLogLevel = "error" Light TaskRecordLogLevel = "light" )
Click to show internal directories.
Click to hide internal directories.