gitea源码

miscellaneous.go 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. // Copyright 2015 The Gogs Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package structs
  4. // SearchResults results of a successful search
  5. type SearchResults struct {
  6. // OK indicates if the search was successful
  7. OK bool `json:"ok"`
  8. // Data contains the repository search results
  9. Data []*Repository `json:"data"`
  10. }
  11. // SearchError error of a failed search
  12. type SearchError struct {
  13. // OK indicates the search status (always false for errors)
  14. OK bool `json:"ok"`
  15. // Error contains the error message
  16. Error string `json:"error"`
  17. }
  18. // MarkupOption markup options
  19. type MarkupOption struct {
  20. // Text markup to render
  21. //
  22. // in: body
  23. Text string
  24. // Mode to render (markdown, comment, wiki, file)
  25. //
  26. // in: body
  27. Mode string
  28. // URL path for rendering issue, media and file links
  29. // Expected format: /subpath/{user}/{repo}/src/{branch, commit, tag}/{identifier/path}/{file/dir}
  30. //
  31. // in: body
  32. Context string
  33. // Is it a wiki page? (use mode=wiki instead)
  34. //
  35. // Deprecated: true
  36. // in: body
  37. Wiki bool
  38. // File path for detecting extension in file mode
  39. //
  40. // in: body
  41. FilePath string
  42. }
  43. // MarkupRender is a rendered markup document
  44. // swagger:response MarkupRender
  45. type MarkupRender string
  46. // MarkdownOption markdown options
  47. type MarkdownOption struct {
  48. // Text markdown to render
  49. //
  50. // in: body
  51. Text string
  52. // Mode to render (markdown, comment, wiki, file)
  53. //
  54. // in: body
  55. Mode string
  56. // URL path for rendering issue, media and file links
  57. // Expected format: /subpath/{user}/{repo}/src/{branch, commit, tag}/{identifier/path}/{file/dir}
  58. //
  59. // in: body
  60. Context string
  61. // Is it a wiki page? (use mode=wiki instead)
  62. //
  63. // Deprecated: true
  64. // in: body
  65. Wiki bool
  66. }
  67. // MarkdownRender is a rendered markdown document
  68. // swagger:response MarkdownRender
  69. type MarkdownRender string
  70. // ServerVersion wraps the version of the server
  71. type ServerVersion struct {
  72. // Version is the server version string
  73. Version string `json:"version"`
  74. }
  75. // GitignoreTemplateInfo name and text of a gitignore template
  76. type GitignoreTemplateInfo struct {
  77. // Name is the name of the gitignore template
  78. Name string `json:"name"`
  79. // Source contains the content of the gitignore template
  80. Source string `json:"source"`
  81. }
  82. // LicensesListEntry is used for the API
  83. type LicensesTemplateListEntry struct {
  84. // Key is the unique identifier for the license template
  85. Key string `json:"key"`
  86. // Name is the display name of the license
  87. Name string `json:"name"`
  88. // URL is the reference URL for the license
  89. URL string `json:"url"`
  90. }
  91. // LicensesInfo contains information about a License
  92. type LicenseTemplateInfo struct {
  93. // Key is the unique identifier for the license template
  94. Key string `json:"key"`
  95. // Name is the display name of the license
  96. Name string `json:"name"`
  97. // URL is the reference URL for the license
  98. URL string `json:"url"`
  99. // Implementation contains license implementation details
  100. Implementation string `json:"implementation"`
  101. // Body contains the full text of the license
  102. Body string `json:"body"`
  103. }
  104. // APIError is an api error with a message
  105. type APIError struct {
  106. // Message contains the error description
  107. Message string `json:"message"`
  108. // URL contains the documentation URL for this error
  109. URL string `json:"url"`
  110. }