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.7KB

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