admin

package
v0.3.17-0...-e06e18e Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2021 License: LGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminSocket

type AdminSocket struct {
	// contains filtered or unexported fields
}

func (*AdminSocket) AddHandler

func (a *AdminSocket) AddHandler(name string, args []string, handlerfunc func(json.RawMessage) (interface{}, error)) error

AddHandler is called for each admin function to add the handler and help documentation to the API.

func (*AdminSocket) Init

func (a *AdminSocket) Init(c *core.Core, nc *config.NodeConfig, log *log.Logger, options interface{}) error

Init runs the initial admin setup.

func (*AdminSocket) IsStarted

func (a *AdminSocket) IsStarted() bool

IsStarted returns true if the module has been started.

func (*AdminSocket) SetupAdminHandlers

func (a *AdminSocket) SetupAdminHandlers(na *AdminSocket)

func (*AdminSocket) Start

func (a *AdminSocket) Start() error

Start runs the admin API socket to listen for / respond to admin API calls.

func (*AdminSocket) Stop

func (a *AdminSocket) Stop() error

Stop will stop the admin API and close the socket.

type AdminSocketResponse

type AdminSocketResponse struct {
	Status  string `json:"status"`
	Request struct {
		Name      string `json:"request"`
		KeepAlive bool   `json:"keepalive"`
	} `json:"request"`
	Response interface{} `json:"response"`
}

type DHTEntry

type DHTEntry struct {
	PublicKey string `json:"key"`
	Port      uint64 `json:"port"`
	Rest      uint64 `json:"rest"`
}

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
}

type GetDHTRequest

type GetDHTRequest struct{}

type GetDHTResponse

type GetDHTResponse struct {
	DHT map[string]DHTEntry `json:"dht"`
}

type GetPathsRequest

type GetPathsRequest struct {
}

type GetPathsResponse

type GetPathsResponse struct {
	Paths map[string]PathEntry `json:"paths"`
}

type GetPeersRequest

type GetPeersRequest struct {
}

type GetPeersResponse

type GetPeersResponse struct {
	Peers map[string]PeerEntry `json:"peers"`
}

type GetSelfRequest

type GetSelfRequest struct{}

type GetSelfResponse

type GetSelfResponse struct {
	Self map[string]SelfEntry `json:"self"`
}

type GetSessionsRequest

type GetSessionsRequest struct{}

type GetSessionsResponse

type GetSessionsResponse struct {
	Sessions map[string]SessionEntry `json:"sessions"`
}

type ListEntry

type ListEntry struct {
	Fields []string `json:"fields"`
}

type ListResponse

type ListResponse struct {
	List map[string]ListEntry `json:"list"`
}

type PathEntry

type PathEntry struct {
	PublicKey string   `json:"key"`
	Path      []uint64 `json:"path"`
}

type PeerEntry

type PeerEntry struct {
	PublicKey string   `json:"key"`
	Port      uint64   `json:"port"`
	Coords    []uint64 `json:"coords"`
}

type SelfEntry

type SelfEntry struct {
	BuildName    string   `json:"build_name"`
	BuildVersion string   `json:"build_version"`
	PublicKey    string   `json:"key"`
	Coords       []uint64 `json:"coords"`
	Subnet       string   `json:"subnet"`
}

type SessionEntry

type SessionEntry struct {
	PublicKey string `json:"key"`
}

Jump to

Keyboard shortcuts

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