gitea源码

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // Copyright 2020 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package structs
  4. // GeneralRepoSettings contains global repository settings exposed by API
  5. type GeneralRepoSettings struct {
  6. // MirrorsDisabled indicates if repository mirroring is disabled
  7. MirrorsDisabled bool `json:"mirrors_disabled"`
  8. // HTTPGitDisabled indicates if HTTP Git operations are disabled
  9. HTTPGitDisabled bool `json:"http_git_disabled"`
  10. // MigrationsDisabled indicates if repository migrations are disabled
  11. MigrationsDisabled bool `json:"migrations_disabled"`
  12. // StarsDisabled indicates if repository starring is disabled
  13. StarsDisabled bool `json:"stars_disabled"`
  14. // TimeTrackingDisabled indicates if time tracking is disabled
  15. TimeTrackingDisabled bool `json:"time_tracking_disabled"`
  16. // LFSDisabled indicates if Git LFS support is disabled
  17. LFSDisabled bool `json:"lfs_disabled"`
  18. }
  19. // GeneralUISettings contains global ui settings exposed by API
  20. type GeneralUISettings struct {
  21. // DefaultTheme is the default UI theme
  22. DefaultTheme string `json:"default_theme"`
  23. // AllowedReactions contains the list of allowed emoji reactions
  24. AllowedReactions []string `json:"allowed_reactions"`
  25. // CustomEmojis contains the list of custom emojis
  26. CustomEmojis []string `json:"custom_emojis"`
  27. }
  28. // GeneralAPISettings contains global api settings exposed by it
  29. type GeneralAPISettings struct {
  30. // MaxResponseItems is the maximum number of items returned in API responses
  31. MaxResponseItems int `json:"max_response_items"`
  32. // DefaultPagingNum is the default number of items per page
  33. DefaultPagingNum int `json:"default_paging_num"`
  34. // DefaultGitTreesPerPage is the default number of Git tree items per page
  35. DefaultGitTreesPerPage int `json:"default_git_trees_per_page"`
  36. // DefaultMaxBlobSize is the default maximum blob size for API responses
  37. DefaultMaxBlobSize int64 `json:"default_max_blob_size"`
  38. // DefaultMaxResponseSize is the default maximum response size
  39. DefaultMaxResponseSize int64 `json:"default_max_response_size"`
  40. }
  41. // GeneralAttachmentSettings contains global Attachment settings exposed by API
  42. type GeneralAttachmentSettings struct {
  43. // Enabled indicates if file attachments are enabled
  44. Enabled bool `json:"enabled"`
  45. // AllowedTypes contains the allowed file types for attachments
  46. AllowedTypes string `json:"allowed_types"`
  47. // MaxSize is the maximum size for individual attachments
  48. MaxSize int64 `json:"max_size"`
  49. // MaxFiles is the maximum number of files per attachment
  50. MaxFiles int `json:"max_files"`
  51. }