gitea源码

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // Copyright 2016 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package structs
  4. import (
  5. "time"
  6. )
  7. // Release represents a repository release
  8. type Release struct {
  9. // The unique identifier of the release
  10. ID int64 `json:"id"`
  11. // The name of the git tag associated with the release
  12. TagName string `json:"tag_name"`
  13. // The target commitish for the release
  14. Target string `json:"target_commitish"`
  15. // The display title of the release
  16. Title string `json:"name"`
  17. // The release notes or description
  18. Note string `json:"body"`
  19. // The API URL of the release
  20. URL string `json:"url"`
  21. // The HTML URL to view the release
  22. HTMLURL string `json:"html_url"`
  23. // The URL to download the tarball archive
  24. TarURL string `json:"tarball_url"`
  25. // The URL to download the zip archive
  26. ZipURL string `json:"zipball_url"`
  27. // The URL template for uploading release assets
  28. UploadURL string `json:"upload_url"`
  29. // Whether the release is a draft
  30. IsDraft bool `json:"draft"`
  31. // Whether the release is a prerelease
  32. IsPrerelease bool `json:"prerelease"`
  33. // swagger:strfmt date-time
  34. CreatedAt time.Time `json:"created_at"`
  35. // swagger:strfmt date-time
  36. PublishedAt time.Time `json:"published_at"`
  37. // The user who published the release
  38. Publisher *User `json:"author"`
  39. // The files attached to the release
  40. Attachments []*Attachment `json:"assets"`
  41. }
  42. // CreateReleaseOption options when creating a release
  43. type CreateReleaseOption struct {
  44. // required: true
  45. TagName string `json:"tag_name" binding:"Required"`
  46. // The message for the git tag
  47. TagMessage string `json:"tag_message"`
  48. // The target commitish for the release
  49. Target string `json:"target_commitish"`
  50. // The display title of the release
  51. Title string `json:"name"`
  52. // The release notes or description
  53. Note string `json:"body"`
  54. // Whether to create the release as a draft
  55. IsDraft bool `json:"draft"`
  56. // Whether to mark the release as a prerelease
  57. IsPrerelease bool `json:"prerelease"`
  58. }
  59. // EditReleaseOption options when editing a release
  60. type EditReleaseOption struct {
  61. // The new name of the git tag
  62. TagName string `json:"tag_name"`
  63. // The new target commitish for the release
  64. Target string `json:"target_commitish"`
  65. // The new display title of the release
  66. Title string `json:"name"`
  67. // The new release notes or description
  68. Note string `json:"body"`
  69. // Whether to change the draft status
  70. IsDraft *bool `json:"draft"`
  71. // Whether to change the prerelease status
  72. IsPrerelease *bool `json:"prerelease"`
  73. }