Documentation ¶
Index ¶
- Constants
- Variables
- func AddJob(job ZapJobInterface)
- func AppInstallAction(c *gin.Context)
- func AppUninstallAction(c *gin.Context)
- func CancelTask(id uint) bool
- func LoadTask(status ...string)
- func RegisterRouter(r *gin.RouterGroup)
- func StartServer(ctx context.Context)
- func StartTaskQueue()
- func StartTaskScheduler()
- func SystemdAction(c *gin.Context)
- func TaskCancelAction(c *gin.Context)
- func UpgradeAction(c *gin.Context)
- func UpgradeZapd()
- type AppStoreJob
- type BashJob
- type EmailJob
- type HttpJob
- type InstallApp
- type Scheduler
- type TaskCommand
- type ZapJob
- type ZapJobInterface
Constants ¶
View Source
const ( STATUS_WAIT = "wait" STATUS_READY = "ready" STATUS_SUSPEND = "suspend" STATUS_RUNNING = "running" STATUS_COMPLETE = "complete" STATUS_CANCEL = "cancel" STATUS_FAILED = "failed" )
View Source
const ( TASK_TYPE_APPSTORE = "appstore" TASK_TYPE_EMAIL = "email" TASK_TYPE_HTTP = "http" )
View Source
const (
INSTALL_RUNNING_KEY = "install_task_running"
)
Variables ¶
View Source
var GL sync.Map
View Source
var TASK_SERV_SOCK = "/var/run/zap_task"
View Source
var ZAP_MIRROR_URL = "https://mirrors.zap.cn/zap"
Functions ¶
func AddJob ¶
func AddJob(job ZapJobInterface)
func AppInstallAction ¶
func AppUninstallAction ¶
func CancelTask ¶
func RegisterRouter ¶
func RegisterRouter(r *gin.RouterGroup)
func StartServer ¶
func StartTaskQueue ¶
func StartTaskQueue()
func StartTaskScheduler ¶
func StartTaskScheduler()
func SystemdAction ¶
func TaskCancelAction ¶
func UpgradeAction ¶
func UpgradeZapd ¶
func UpgradeZapd()
Types ¶
type AppStoreJob ¶
type AppStoreJob struct { Ctx context.Context TaskData *models.ZapTask Cmd string AppId int //apps ID AppStoreUniqueId string // appstore unique id AppStoreId int // appstore id }
func (*AppStoreJob) Clean ¶
func (b *AppStoreJob) Clean()
func (*AppStoreJob) Execute ¶
func (b *AppStoreJob) Execute() (err error)
type InstallApp ¶
type TaskCommand ¶
type ZapJob ¶
type ZapJob struct { TaskCtx context.Context TaskCancel context.CancelFunc TaskType string JobId uint Cmd string StartTime int64 EndTime int64 Retry int TaskData *models.ZapTask Status bool }
func (*ZapJob) ExecuteSuccess ¶
func (z *ZapJob) ExecuteSuccess()
type ZapJobInterface ¶
type ZapJobInterface interface {
Execute()
}
Click to show internal directories.
Click to hide internal directories.