code.gitea.io/gitea@v1.19.3/modules/structs/nodeinfo.go (about)

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