本站源代码
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

35 lines
911B

  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. )
上海开阖软件有限公司 沪ICP备12045867号-1