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.

repo_commit.go 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. }