nodeinfo

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2021 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Overview

Code generated by counterfeiter. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var OrbVersion = "latest"

OrbVersion contains the version of the Orb 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

func NewHandler(version Version, retriever nodeInfoRetriever) *Handler

NewHandler returns the /nodeinfo REST handler.

func (*Handler) Handler

func (h *Handler) Handler() common.HTTPRequestHandler

Handler returns the HTTP REST handle for the NodeInfo handler.

func (*Handler) Method

func (h *Handler) Method() string

Method returns the HTTP REST method for the NodeInfo handler.

func (*Handler) Path

func (h *Handler) Path() string

Path returns the HTTP REST endpoint 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

type Service struct {
	*lifecycle.Lifecycle
	// contains filtered or unexported fields
}

Service periodically polls various Orb services and produces NodeInfo data.

func NewService

func NewService(apStore apstore.Store, serviceIRI *url.URL, refreshInterval time.Duration) *Service

NewService returns a new NodeInfo service.

func (*Service) GetNodeInfo

func (r *Service) GetNodeInfo(version Version) *NodeInfo

GetNodeInfo returns a NodeInfo struct compatible with the given version.

type Services

type Services struct {
	Inbound  []string `json:"inbound"`
	Outbound []string `json:"outbound"`
}

Services contains services. (Currently Orb does not use this object.)

type Software

type Software struct {
	Name       string `json:"name"`
	Version    string `json:"version"`
	Repository string `json:"repository,omitempty"`
}

Software contains information about the Orb 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"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL