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 839B

123456789101112131415161718192021222324252627282930313233
  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. // all kinds of task types
  7. const (
  8. TaskTypeMigrateRepo TaskType = iota // migrate repository from external or local disk
  9. )
  10. // Name returns the task type name
  11. func (taskType TaskType) Name() string {
  12. switch taskType {
  13. case TaskTypeMigrateRepo:
  14. return "Migrate Repository"
  15. }
  16. return ""
  17. }
  18. // TaskStatus defines task status
  19. type TaskStatus int
  20. // enumerate all the kinds of task status
  21. const (
  22. TaskStatusQueue TaskStatus = iota // 0 task is queue
  23. TaskStatusRunning // 1 task is running
  24. TaskStatusStopped // 2 task is stopped
  25. TaskStatusFailed // 3 task is failed
  26. TaskStatusFinished // 4 task is finished
  27. )