api

package
v0.0.0-...-23d3fd2 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequestTimeout = 5 * time.Second
	DefaultPort    = "5001"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	LastRefresh string       `json:"LastRefresh"`
	Peers       []BucketPeer `json:"Peers"`
}

type BucketPeer

type BucketPeer struct {
	ID            string `json:"ID"`
	Connected     bool   `json:"Connected"`
	AgentVersion  string `json:"AgentVersion"`
	LastUsefulAt  string `json:"LastUsefulAt"`
	LastQueriedAt string `json:"LastQueriedAt"`
}

type Client

type Client struct {
	http.Client
}

func NewClient

func NewClient() *Client

func (*Client) ID

func (c *Client) ID(ctx context.Context, host string) (*IDResponse, error)

func (*Client) RoutingTable

func (c *Client) RoutingTable(ctx context.Context, host string) (*RoutingTableResponse, error)

type IDResponse

type IDResponse struct {
	ID              string
	PublicKey       string
	Addresses       []string
	AgentVersion    string
	ProtocolVersion string
	Protocols       []string
}

type RoutingTableResponse

type RoutingTableResponse struct {
	Name    string   `json:"Name"`
	Buckets []Bucket `json:"Buckets"`
}

Jump to

Keyboard shortcuts

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