You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

nodeinfo.go 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Copyright 2021 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package structs
  4. // NodeInfo contains standardized way of exposing metadata about a server running one of the distributed social networks
  5. type NodeInfo struct {
  6. Version string `json:"version"`
  7. Software NodeInfoSoftware `json:"software"`
  8. Protocols []string `json:"protocols"`
  9. Services NodeInfoServices `json:"services"`
  10. OpenRegistrations bool `json:"openRegistrations"`
  11. Usage NodeInfoUsage `json:"usage"`
  12. Metadata struct{} `json:"metadata"`
  13. }
  14. // NodeInfoSoftware contains Metadata about server software in use
  15. type NodeInfoSoftware struct {
  16. Name string `json:"name"`
  17. Version string `json:"version"`
  18. Repository string `json:"repository"`
  19. Homepage string `json:"homepage"`
  20. }
  21. // NodeInfoServices contains the third party sites this server can connect to via their application API
  22. type NodeInfoServices struct {
  23. Inbound []string `json:"inbound"`
  24. Outbound []string `json:"outbound"`
  25. }
  26. // NodeInfoUsage contains usage statistics for this server
  27. type NodeInfoUsage struct {
  28. Users NodeInfoUsageUsers `json:"users"`
  29. LocalPosts int `json:"localPosts,omitempty"`
  30. LocalComments int `json:"localComments,omitempty"`
  31. }
  32. // NodeInfoUsageUsers contains statistics about the users of this server
  33. type NodeInfoUsageUsers struct {
  34. Total int `json:"total,omitempty"`
  35. ActiveHalfyear int `json:"activeHalfyear,omitempty"`
  36. ActiveMonth int `json:"activeMonth,omitempty"`
  37. }