Documentation ¶
Overview ¶
Code generated by counterfeiter. DO NOT EDIT.
Index ¶
- Variables
- type Handler
- type NodeInfo
- type NodeInfoRetriever
- func (fake *NodeInfoRetriever) GetNodeInfo(version Version) *NodeInfo
- func (fake *NodeInfoRetriever) GetNodeInfoArgsForCall(i int) Version
- func (fake *NodeInfoRetriever) GetNodeInfoCallCount() int
- func (fake *NodeInfoRetriever) GetNodeInfoReturns(result1 *NodeInfo)
- func (fake *NodeInfoRetriever) GetNodeInfoReturnsOnCall(i int, result1 *NodeInfo)
- func (fake *NodeInfoRetriever) Invocations() map[string][][]interface{}
- type Service
- type Services
- type Software
- type Usage
- type Users
- type Version
Constants ¶
This section is empty.
Variables ¶
var OakVersion = "latest"
OakVersion contains the version of the Oak build.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler implements the /nodeinfo REST endpoint.
func NewHandler ¶
NewHandler returns the /nodeinfo REST handler. If logger is nil, then a default will be used.
func (*Handler) Handler ¶
func (h *Handler) Handler() common.HTTPRequestHandler
Handler returns the HTTP REST handle for the NodeInfo handler.
type NodeInfo ¶
type NodeInfo struct { Version string `json:"version"` Software Software `json:"software"` Protocols []string `json:"protocols"` Services Services `json:"services"` OpenRegistrations bool `json:"openRegistrations"` Usage Usage `json:"usage"` Metadata map[string]interface{} `json:"metadata,omitempty"` }
NodeInfo contains NodeInfo data.
type NodeInfoRetriever ¶
type NodeInfoRetriever struct { GetNodeInfoStub func(version Version) *NodeInfo // contains filtered or unexported fields }
func (*NodeInfoRetriever) GetNodeInfo ¶
func (fake *NodeInfoRetriever) GetNodeInfo(version Version) *NodeInfo
func (*NodeInfoRetriever) GetNodeInfoArgsForCall ¶
func (fake *NodeInfoRetriever) GetNodeInfoArgsForCall(i int) Version
func (*NodeInfoRetriever) GetNodeInfoCallCount ¶
func (fake *NodeInfoRetriever) GetNodeInfoCallCount() int
func (*NodeInfoRetriever) GetNodeInfoReturns ¶
func (fake *NodeInfoRetriever) GetNodeInfoReturns(result1 *NodeInfo)
func (*NodeInfoRetriever) GetNodeInfoReturnsOnCall ¶
func (fake *NodeInfoRetriever) GetNodeInfoReturnsOnCall(i int, result1 *NodeInfo)
func (*NodeInfoRetriever) Invocations ¶
func (fake *NodeInfoRetriever) Invocations() map[string][][]interface{}
type Service ¶
Service periodically polls various Oak services and produces NodeInfo data.
func NewService ¶
func NewService(serviceIRI *url.URL, refreshInterval time.Duration, apStore apstore.Store, multipleTagQueryCapable bool) *Service
NewService returns a new NodeInfo service. If this Oak server uses a storage provider that can do queries using 2 tags, then we can take advantage of a feature in the underlying Aries storage provider to update the stats more efficiently. If logger is nil, then a default will be used.
func (*Service) GetNodeInfo ¶
GetNodeInfo returns a NodeInfo struct compatible with the given version.
type Software ¶
type Software struct { Name string `json:"name"` Version string `json:"version"` Repository string `json:"repository,omitempty"` }
Software contains information about the Oak application, including version.
type Usage ¶
type Usage struct { Users Users `json:"users"` LocalPosts int `json:"localPosts"` LocalComments int `json:"localComments"` }
Usage contains usage statistics, including the number of 'Create' and 'Like' activities were issued by this node.
type Users ¶
type Users struct {
Total int `json:"total"`
}
Users contains the number of users. (Currently always 1.)
type Version ¶
type Version = string
Version specified the version of the NodeInfo data.
const ( // V2_0 is NodeInfo version 2.0 (http://nodeinfo.diaspora.software/ns/schema/2.0#). V2_0 Version = "2.0" // V2_1 is NodeInfo version 2.1 (http://nodeinfo.diaspora.software/ns/schema/2.1#). V2_1 Version = "2.1" )