api

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: GPL-3.0 Imports: 5 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 {
	Username string
	Password string
	BaseURL  string
	Hostname string
	Client   *http.Client
}

API is a utility for communicating with the Mullvad API

func (*API) GetWireguardPeers

func (a *API) GetWireguardPeers() (WireguardPeerList, error)

GetWireguardPeers fetches a list of wireguard peers from the API and returns it

func (*API) PostWireguardConnections added in v1.2.4

func (a *API) PostWireguardConnections(keys ConnectedKeysMap) error

PostWireguardConnections posts the number of connected wireguard keys to the API

type ConnectedKeysMap added in v1.2.4

type ConnectedKeysMap map[string]int

ConnectedKeysMap contains connected keys and their respective numer of keys

type WireguardPeer

type WireguardPeer struct {
	IPv4   string   `json:"ipv4"`
	IPv6   string   `json:"ipv6"`
	Ports  []int    `json:"ports"`
	Cities []string `json:"cities,omitempty"`
	Pubkey string   `json:"pubkey"`
}

WireguardPeer is a wireguard peer

type WireguardPeerList

type WireguardPeerList []WireguardPeer

WireguardPeerList is a list of Wireguard peers

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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