admin

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: LGPL-3.0 Imports: 16 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddPeerRequest added in v0.4.5

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

type AddPeerResponse added in v0.4.5

type AddPeerResponse struct{}

type AdminSocket

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

func New added in v0.4.5

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 added in v0.3.14

func (a *AdminSocket) IsStarted() bool

IsStarted returns true if the module has been started.

func (*AdminSocket) SetupAdminHandlers added in v0.3.14

func (a *AdminSocket) SetupAdminHandlers()

func (*AdminSocket) Stop

func (a *AdminSocket) Stop() error

Stop will stop the admin API and close the socket.

type AdminSocketRequest added in v0.4.5

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

type AdminSocketResponse added in v0.4.0

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

type DataUnit added in v0.4.5

type DataUnit uint64

func (DataUnit) String added in v0.4.5

func (d DataUnit) String() string

type ErrorResponse added in v0.4.0

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

type GetPathsRequest added in v0.4.0

type GetPathsRequest struct {
}

type GetPathsResponse added in v0.4.0

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

type GetPeersRequest added in v0.4.0

type GetPeersRequest struct {
}

type GetPeersResponse added in v0.4.0

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

type GetSelfRequest added in v0.4.0

type GetSelfRequest struct{}

type GetSelfResponse added in v0.4.0

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 added in v0.4.0

type GetSessionsRequest struct{}

type GetSessionsResponse added in v0.4.0

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

type GetTreeRequest added in v0.5.0

type GetTreeRequest struct{}

type GetTreeResponse added in v0.5.0

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

type ListEntry added in v0.4.0

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

type ListResponse added in v0.4.0

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

type ListenAddress added in v0.4.5

type ListenAddress string

type LogLookups added in v0.5.0

type LogLookups struct{}

type PathEntry added in v0.4.0

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

type PeerEntry added in v0.4.0

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"`
	RXBytes       DataUnit      `json:"bytes_recvd,omitempty"`
	TXBytes       DataUnit      `json:"bytes_sent,omitempty"`
	Uptime        float64       `json:"uptime,omitempty"`
	LastError     string        `json:"last_error,omitempty"`
	LastErrorTime time.Duration `json:"last_error_time,omitempty"`
}

type RemovePeerRequest added in v0.4.5

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

type RemovePeerResponse added in v0.4.5

type RemovePeerResponse struct{}

type SessionEntry added in v0.4.0

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 added in v0.4.5

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

type TreeEntry added in v0.5.0

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