pia

package
v0.0.0-...-573d2e9 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddKeyResult

type AddKeyResult struct {
	Status     string   `json:"status"`
	ServerKey  string   `json:"server_key"`
	ServerPort int      `json:"server_port"`
	ServerIP   string   `json:"server_ip"`
	ServerVip  string   `json:"server_vip"`
	PeerIP     string   `json:"peer_ip"`
	PeerPubkey string   `json:"peer_pubkey"`
	DNSServers []string `json:"dns_servers"`
}

type PIAClient

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

func NewPIAClient

func NewPIAClient(username, password, region string, verbose bool) (*PIAClient, error)

NewPIAClient creates a new PIA client for with the list of servers populated

func (*PIAClient) AddKey

func (p *PIAClient) AddKey(token, publickey string) (AddKeyResult, error)

AddKey

func (*PIAClient) GetToken

func (p *PIAClient) GetToken() (string, error)

GetToken

type PIAWgClient

type PIAWgClient interface {
	GetToken() (string, error)
	AddKey(token, publickey string) (AddKeyResult, error)
}

type PIAWgGenerator

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

func NewPIAWgGenerator

func NewPIAWgGenerator(pia PIAWgClient, config PIAWgGeneratorConfig) *PIAWgGenerator

func (*PIAWgGenerator) Generate

func (p *PIAWgGenerator) Generate() (string, error)

Generate

type PIAWgGeneratorConfig

type PIAWgGeneratorConfig struct {
	Verbose    bool
	PrivateKey string
	PublicKey  string
}

type Region

type Region string

type Server

type Server struct {
	Cn string
	IP string
}

type ServerList

type ServerList map[Region][]Server

Jump to

Keyboard shortcuts

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