gitea源码

package.go 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Copyright 2021 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package structs
  4. import (
  5. "time"
  6. )
  7. // Package represents a package
  8. type Package struct {
  9. // The unique identifier of the package
  10. ID int64 `json:"id"`
  11. // The owner of the package
  12. Owner *User `json:"owner"`
  13. // The repository that contains this package
  14. Repository *Repository `json:"repository"`
  15. // The user who created this package
  16. Creator *User `json:"creator"`
  17. // The type of the package (e.g., npm, maven, docker)
  18. Type string `json:"type"`
  19. // The name of the package
  20. Name string `json:"name"`
  21. // The version of the package
  22. Version string `json:"version"`
  23. // The HTML URL to view the package
  24. HTMLURL string `json:"html_url"`
  25. // swagger:strfmt date-time
  26. // The date and time when the package was created
  27. CreatedAt time.Time `json:"created_at"`
  28. }
  29. // PackageFile represents a package file
  30. type PackageFile struct {
  31. // The unique identifier of the package file
  32. ID int64 `json:"id"`
  33. // The size of the package file in bytes
  34. Size int64 `json:"size"`
  35. // The name of the package file
  36. Name string `json:"name"`
  37. // The MD5 hash of the package file
  38. HashMD5 string `json:"md5"`
  39. // The SHA1 hash of the package file
  40. HashSHA1 string `json:"sha1"`
  41. // The SHA256 hash of the package file
  42. HashSHA256 string `json:"sha256"`
  43. // The SHA512 hash of the package file
  44. HashSHA512 string `json:"sha512"`
  45. }