本站源代码
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

45 lines
1.3KB

  1. // Copyright 2018 The Gogs Authors. All rights reserved.
  2. // Copyright 2019 The Gitea Authors. 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 structs
  6. // Identity for a person's identity like an author or committer
  7. type Identity struct {
  8. Name string `json:"name" binding:"MaxSize(100)"`
  9. // swagger:strfmt email
  10. Email string `json:"email" binding:"MaxSize(254)"`
  11. }
  12. // CommitMeta contains meta information of a commit in terms of API.
  13. type CommitMeta struct {
  14. URL string `json:"url"`
  15. SHA string `json:"sha"`
  16. }
  17. // CommitUser contains information of a user in the context of a commit.
  18. type CommitUser struct {
  19. Identity
  20. Date string `json:"date"`
  21. }
  22. // RepoCommit contains information of a commit in the context of a repository.
  23. type RepoCommit struct {
  24. URL string `json:"url"`
  25. Author *CommitUser `json:"author"`
  26. Committer *CommitUser `json:"committer"`
  27. Message string `json:"message"`
  28. Tree *CommitMeta `json:"tree"`
  29. }
  30. // Commit contains information generated from a Git commit.
  31. type Commit struct {
  32. *CommitMeta
  33. HTMLURL string `json:"html_url"`
  34. RepoCommit *RepoCommit `json:"commit"`
  35. Author *User `json:"author"`
  36. Committer *User `json:"committer"`
  37. Parents []*CommitMeta `json:"parents"`
  38. }
上海开阖软件有限公司 沪ICP备12045867号-1