gitea源码

repo_wiki.go 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // Copyright 2021 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package structs
  4. // WikiCommit page commit/revision
  5. type WikiCommit struct {
  6. // The commit SHA hash
  7. ID string `json:"sha"`
  8. // The author of the commit
  9. Author *CommitUser `json:"author"`
  10. // The committer of the commit
  11. Committer *CommitUser `json:"commiter"`
  12. // The commit message
  13. Message string `json:"message"`
  14. }
  15. // WikiPage a wiki page
  16. type WikiPage struct {
  17. *WikiPageMetaData
  18. // Page content, base64 encoded
  19. ContentBase64 string `json:"content_base64"`
  20. // The number of commits that modified this page
  21. CommitCount int64 `json:"commit_count"`
  22. // The sidebar content for the wiki page
  23. Sidebar string `json:"sidebar"`
  24. // The footer content for the wiki page
  25. Footer string `json:"footer"`
  26. }
  27. // WikiPageMetaData wiki page meta information
  28. type WikiPageMetaData struct {
  29. // The title of the wiki page
  30. Title string `json:"title"`
  31. // The HTML URL to view the wiki page
  32. HTMLURL string `json:"html_url"`
  33. // The sub URL path for the wiki page
  34. SubURL string `json:"sub_url"`
  35. // The last commit that modified this wiki page
  36. LastCommit *WikiCommit `json:"last_commit"`
  37. }
  38. // CreateWikiPageOptions form for creating wiki
  39. type CreateWikiPageOptions struct {
  40. // page title. leave empty to keep unchanged
  41. Title string `json:"title"`
  42. // content must be base64 encoded
  43. ContentBase64 string `json:"content_base64"`
  44. // optional commit message summarizing the change
  45. Message string `json:"message"`
  46. }
  47. // WikiCommitList commit/revision list
  48. type WikiCommitList struct {
  49. // The list of wiki commits
  50. WikiCommits []*WikiCommit `json:"commits"`
  51. // The total count of commits
  52. Count int64 `json:"count"`
  53. }