You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

task.go 821B

123456789101112131415161718192021222324252627282930
  1. // Copyright 2019 Gitea. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package structs
  4. // TaskType defines task type
  5. type TaskType int
  6. const TaskTypeMigrateRepo TaskType = iota // migrate repository from external or local disk
  7. // Name returns the task type name
  8. func (taskType TaskType) Name() string {
  9. switch taskType {
  10. case TaskTypeMigrateRepo:
  11. return "Migrate Repository"
  12. }
  13. return ""
  14. }
  15. // TaskStatus defines task status
  16. type TaskStatus int
  17. // enumerate all the kinds of task status
  18. const (
  19. TaskStatusQueued TaskStatus = iota // 0 task is queued
  20. TaskStatusRunning // 1 task is running
  21. TaskStatusStopped // 2 task is stopped (never used)
  22. TaskStatusFailed // 3 task is failed
  23. TaskStatusFinished // 4 task is finished
  24. )