code.gitea.io/gitea@v1.19.3/modules/structs/repo_commit.go (about) 1 // Copyright 2018 The Gogs Authors. All rights reserved. 2 // Copyright 2019 The Gitea Authors. All rights reserved. 3 // SPDX-License-Identifier: MIT 4 5 package structs 6 7 import ( 8 "time" 9 ) 10 11 // Identity for a person's identity like an author or committer 12 type Identity struct { 13 Name string `json:"name" binding:"MaxSize(100)"` 14 // swagger:strfmt email 15 Email string `json:"email" binding:"MaxSize(254)"` 16 } 17 18 // CommitMeta contains meta information of a commit in terms of API. 19 type CommitMeta struct { 20 URL string `json:"url"` 21 SHA string `json:"sha"` 22 // swagger:strfmt date-time 23 Created time.Time `json:"created"` 24 } 25 26 // CommitUser contains information of a user in the context of a commit. 27 type CommitUser struct { 28 Identity 29 Date string `json:"date"` 30 } 31 32 // RepoCommit contains information of a commit in the context of a repository. 33 type RepoCommit struct { 34 URL string `json:"url"` 35 Author *CommitUser `json:"author"` 36 Committer *CommitUser `json:"committer"` 37 Message string `json:"message"` 38 Tree *CommitMeta `json:"tree"` 39 Verification *PayloadCommitVerification `json:"verification"` 40 } 41 42 // CommitStats is statistics for a RepoCommit 43 type CommitStats struct { 44 Total int `json:"total"` 45 Additions int `json:"additions"` 46 Deletions int `json:"deletions"` 47 } 48 49 // Commit contains information generated from a Git commit. 50 type Commit struct { 51 *CommitMeta 52 HTMLURL string `json:"html_url"` 53 RepoCommit *RepoCommit `json:"commit"` 54 Author *User `json:"author"` 55 Committer *User `json:"committer"` 56 Parents []*CommitMeta `json:"parents"` 57 Files []*CommitAffectedFiles `json:"files"` 58 Stats *CommitStats `json:"stats"` 59 } 60 61 // CommitDateOptions store dates for GIT_AUTHOR_DATE and GIT_COMMITTER_DATE 62 type CommitDateOptions struct { 63 // swagger:strfmt date-time 64 Author time.Time `json:"author"` 65 // swagger:strfmt date-time 66 Committer time.Time `json:"committer"` 67 } 68 69 // CommitAffectedFiles store information about files affected by the commit 70 type CommitAffectedFiles struct { 71 Filename string `json:"filename"` 72 }