api

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: May 11, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeInfo

type NodeInfo struct {
	BoxPubKey    string `json:"box_pub_key"`
	BuildName    string `json:"build_name"`
	BuildVersion string `json:"build_version"`
	Coords       string `json:"coords"`
	IPv6Addr     string `json:"ipv6_address"`
	Subnet       string `json:"subnet"`
}

NodeInfo is the object return by the getself admin API call

type Peer

type Peer struct {
	IPv6Addr   string  `json:"ipv6_address"`
	BytesRecvd int     `json:"bytes_recvd"`
	BytesSent  int     `json:"bytes_sent"`
	Endpoint   string  `json:"endpoint"`
	Port       int     `json:"port"`
	Proto      string  `json:"proto"`
	Uptime     float64 `json:"uptime"`
}

Peer is the object return by the getpeers admin API call

type YggdrasilAdminAPI

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

YggdrasilAdminAPI is a client that talk to the yggdrasil admin API

func NewYggdrasil

func NewYggdrasil(connectionURI string) *YggdrasilAdminAPI

NewYggdrasil create a new yggdrasil admin API client by connecting to connectionURI

func (*YggdrasilAdminAPI) AddPeer

func (y *YggdrasilAdminAPI) AddPeer(uri string) ([]string, error)

AddPeer implement the addpeer Admin API call

func (*YggdrasilAdminAPI) Close

func (y *YggdrasilAdminAPI) Close() error

Close closes all connection to the API

func (*YggdrasilAdminAPI) Connect

func (y *YggdrasilAdminAPI) Connect() error

Connect opens the connection to the API

func (*YggdrasilAdminAPI) GetPeers

func (y *YggdrasilAdminAPI) GetPeers() ([]Peer, error)

GetPeers implement the getpeers Admin API call

func (*YggdrasilAdminAPI) GetSelf

func (y *YggdrasilAdminAPI) GetSelf() (nodeinfo NodeInfo, err error)

GetSelf implement the getself Admin API call

Jump to

Keyboard shortcuts

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