code.gitea.io/gitea@v1.19.3/modules/structs/task.go (about) 1 // Copyright 2019 Gitea. All rights reserved. 2 // SPDX-License-Identifier: MIT 3 4 package structs 5 6 // TaskType defines task type 7 type TaskType int 8 9 // all kinds of task types 10 const ( 11 TaskTypeMigrateRepo TaskType = iota // migrate repository from external or local disk 12 ) 13 14 // Name returns the task type name 15 func (taskType TaskType) Name() string { 16 switch taskType { 17 case TaskTypeMigrateRepo: 18 return "Migrate Repository" 19 } 20 return "" 21 } 22 23 // TaskStatus defines task status 24 type TaskStatus int 25 26 // enumerate all the kinds of task status 27 const ( 28 TaskStatusQueue TaskStatus = iota // 0 task is queue 29 TaskStatusRunning // 1 task is running 30 TaskStatusStopped // 2 task is stopped 31 TaskStatusFailed // 3 task is failed 32 TaskStatusFinished // 4 task is finished 33 )