1// Copyright 2019 Gitea. All rights reserved. 2// Use of this source code is governed by a MIT-style 3// license that can be found in the LICENSE file. 4 5package structs 6 7// TaskType defines task type 8type TaskType int 9 10// all kinds of task types 11const ( 12 TaskTypeMigrateRepo TaskType = iota // migrate repository from external or local disk 13) 14 15// Name returns the task type name 16func (taskType TaskType) Name() string { 17 switch taskType { 18 case TaskTypeMigrateRepo: 19 return "Migrate Repository" 20 } 21 return "" 22} 23 24// TaskStatus defines task status 25type TaskStatus int 26 27// enumerate all the kinds of task status 28const ( 29 TaskStatusQueue TaskStatus = iota // 0 task is queue 30 TaskStatusRunning // 1 task is running 31 TaskStatusStopped // 2 task is stopped 32 TaskStatusFailed // 3 task is failed 33 TaskStatusFinished // 4 task is finished 34) 35