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

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