admin

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: LGPL-3.0 Imports: 17 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddPeerRequest

type AddPeerRequest struct {
	Uri   string `json:"uri"`
	Sintf string `json:"interface,omitempty"`
}

type AddPeerResponse

type AddPeerResponse struct{}

type AdminSocket

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

func New

func New(c *core.Core, log core.Logger, opts ...SetupOption) (*AdminSocket, error)

Init runs the initial admin setup.

func (*AdminSocket) AddHandler

func (a *AdminSocket) AddHandler(name, desc string, args []string, handlerfunc core.AddHandlerFunc) error

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

func (*AdminSocket) IsStarted

func (a *AdminSocket) IsStarted() bool

IsStarted returns true if the module has been started.

func (*AdminSocket) SetupAdminHandlers

func (a *AdminSocket) SetupAdminHandlers()

func (*AdminSocket) Stop

func (a *AdminSocket) Stop() error

Stop will stop the admin API and close the socket.

type AdminSocketRequest

type AdminSocketRequest struct {
	Name      string          `json:"request"`
	Arguments json.RawMessage `json:"arguments,omitempty"`
	KeepAlive bool            `json:"keepalive,omitempty"`
}

type AdminSocketResponse

type AdminSocketResponse struct {
	Status   string             `json:"status"`
	Error    string             `json:"error,omitempty"`
	Request  AdminSocketRequest `json:"request"`
	Response json.RawMessage    `json:"response"`
}

type DataUnit

type DataUnit uint64

func (DataUnit) String

func (d DataUnit) String() string

type ErrorResponse

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

type GetPathsRequest

type GetPathsRequest struct {
}

type GetPathsResponse

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

type GetPeersRequest

type GetPeersRequest struct {
	SortBy string `json:"sort"`
}

type GetPeersResponse

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

type GetSelfRequest

type GetSelfRequest struct{}

type GetSelfResponse

type GetSelfResponse struct {
	BuildName      string `json:"build_name"`
	BuildVersion   string `json:"build_version"`
	PublicKey      string `json:"key"`
	IPAddress      string `json:"address"`
	RoutingEntries uint64 `json:"routing_entries"`
	Subnet         string `json:"subnet"`
}

type GetSessionsRequest

type GetSessionsRequest struct{}

type GetSessionsResponse

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

type GetTreeRequest

type GetTreeRequest struct{}

type GetTreeResponse

type GetTreeResponse struct {
	Tree []TreeEntry `json:"tree"`
}

type ListEntry

type ListEntry struct {
	Command     string   `json:"command"`
	Description string   `json:"description"`
	Fields      []string `json:"fields,omitempty"`
}

type ListResponse

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

type ListenAddress

type ListenAddress string

type LogLookups

type LogLookups struct{}

type PathEntry

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

type PeerEntry

type PeerEntry struct {
	URI           string        `json:"remote,omitempty"`
	Up            bool          `json:"up"`
	Inbound       bool          `json:"inbound"`
	IPAddress     string        `json:"address,omitempty"`
	PublicKey     string        `json:"key"`
	Port          uint64        `json:"port"`
	Priority      uint64        `json:"priority"`
	Cost          uint64        `json:"cost"`
	RXBytes       DataUnit      `json:"bytes_recvd,omitempty"`
	TXBytes       DataUnit      `json:"bytes_sent,omitempty"`
	RXRate        DataUnit      `json:"rate_recvd,omitempty"`
	TXRate        DataUnit      `json:"rate_sent,omitempty"`
	Uptime        float64       `json:"uptime,omitempty"`
	Latency       time.Duration `json:"latency,omitempty"`
	LastErrorTime time.Duration `json:"last_error_time,omitempty"`
	LastError     string        `json:"last_error,omitempty"`
}

type RemovePeerRequest

type RemovePeerRequest struct {
	Uri   string `json:"uri"`
	Sintf string `json:"interface,omitempty"`
}

type RemovePeerResponse

type RemovePeerResponse struct{}

type SessionEntry

type SessionEntry struct {
	IPAddress string   `json:"address"`
	PublicKey string   `json:"key"`
	RXBytes   DataUnit `json:"bytes_recvd"`
	TXBytes   DataUnit `json:"bytes_sent"`
	Uptime    float64  `json:"uptime"`
}

type SetupOption

type SetupOption interface {
	// contains filtered or unexported methods
}

type TreeEntry

type TreeEntry struct {
	IPAddress string `json:"address"`
	PublicKey string `json:"key"`
	Parent    string `json:"parent"`
	Sequence  uint64 `json:"sequence"`
}

Jump to

Keyboard shortcuts

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