api

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

func NewAPIServer

func NewAPIServer(log *logrus.Logger, dev *device.Device, cfg *config.Config) *API

func (*API) ServeHTTP

func (a *API) ServeHTTP(w http.ResponseWriter, r *http.Request)

type AddPeerRequest

type AddPeerRequest struct {
	AllowedIP string `json:"allowedIP"`
}

type AddPeerResponse added in v1.10.0

type AddPeerResponse struct {
	AllowedIP  string `json:"allowedIP"`
	HubNetwork string `json:"hubNetwork"`
}

type AnnotatedPeer added in v1.10.0

type AnnotatedPeer struct {
	*ipc.Peer
	IsHub       bool `json:"isHub"`
	IsRequester bool `json:"isRequester"`
}

type AnnotatedPeers added in v1.10.0

type AnnotatedPeers []*AnnotatedPeer

func (AnnotatedPeers) GetAllowedIPRanges added in v1.10.0

func (p AnnotatedPeers) GetAllowedIPRanges() []string

type AuthRequest

type AuthRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type GeneratePeerRequest added in v1.10.0

type GeneratePeerRequest struct {
	AllowedIP string `json:"allowedIP"`
}

type GeneratePeerResponse added in v1.10.0

type GeneratePeerResponse struct {
	PrivateKey string `json:"privateKey"`
	PublicKey  string `json:"publicKey"`
	AllowedIP  string `json:"allowedIP"`
	HubNetwork string `json:"hubNetwork"`
}

type HubInfo added in v1.8.0

type HubInfo struct {
	PublicKey    string `json:"publicKey"`
	Port         uint16 `json:"port"`
	HubNetwork   string `json:"hubNetwork"`
	RandomFreeIP string `json:"randomFreeIP"`
	ExternalIP   string `json:"externalIP"`
}

Jump to

Keyboard shortcuts

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