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.

issue.go 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // Copyright 2018 Jonas Franz. All rights reserved.
  3. // Use of this source code is governed by a MIT-style
  4. // license that can be found in the LICENSE file.
  5. package migration
  6. import "time"
  7. // IssueContext is used to map between local and foreign issue/PR ids.
  8. type IssueContext interface {
  9. LocalID() int64
  10. ForeignID() int64
  11. }
  12. // BasicIssueContext is a 1:1 mapping between local and foreign ids.
  13. type BasicIssueContext int64
  14. // LocalID gets the local id.
  15. func (c BasicIssueContext) LocalID() int64 {
  16. return int64(c)
  17. }
  18. // ForeignID gets the foreign id.
  19. func (c BasicIssueContext) ForeignID() int64 {
  20. return int64(c)
  21. }
  22. // Issue is a standard issue information
  23. type Issue struct {
  24. Number int64 `json:"number"`
  25. PosterID int64 `yaml:"poster_id" json:"poster_id"`
  26. PosterName string `yaml:"poster_name" json:"poster_name"`
  27. PosterEmail string `yaml:"poster_email" json:"poster_email"`
  28. Title string `json:"title"`
  29. Content string `json:"content"`
  30. Ref string `json:"ref"`
  31. Milestone string `json:"milestone"`
  32. State string `json:"state"` // closed, open
  33. IsLocked bool `yaml:"is_locked" json:"is_locked"`
  34. Created time.Time `json:"created"`
  35. Updated time.Time `json:"updated"`
  36. Closed *time.Time `json:"closed"`
  37. Labels []*Label `json:"labels"`
  38. Reactions []*Reaction `json:"reactions"`
  39. Assignees []string `json:"assignees"`
  40. Context IssueContext `yaml:"-"`
  41. }