gitea源码

repo_tree.go 1.1KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright 2018 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package structs
  4. // GitEntry represents a git tree
  5. type GitEntry struct {
  6. // Path is the file or directory path
  7. Path string `json:"path"`
  8. // Mode is the file mode (permissions)
  9. Mode string `json:"mode"`
  10. // Type indicates if this is a file, directory, or symlink
  11. Type string `json:"type"`
  12. // Size is the file size in bytes
  13. Size int64 `json:"size"`
  14. // SHA is the Git object SHA
  15. SHA string `json:"sha"`
  16. // URL is the API URL for this tree entry
  17. URL string `json:"url"`
  18. }
  19. // GitTreeResponse returns a git tree
  20. type GitTreeResponse struct {
  21. // SHA is the tree object SHA
  22. SHA string `json:"sha"`
  23. // URL is the API URL for this tree
  24. URL string `json:"url"`
  25. // Entries contains the tree entries (files and directories)
  26. Entries []GitEntry `json:"tree"`
  27. // Truncated indicates if the response was truncated due to size
  28. Truncated bool `json:"truncated"`
  29. // Page is the current page number for pagination
  30. Page int `json:"page"`
  31. // TotalCount is the total number of entries in the tree
  32. TotalCount int `json:"total_count"`
  33. }