wg

package
v0.0.0-...-995e40d Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckWGExists

func CheckWGExists() bool

CheckWGExists will check if it can find the wg bin on the user path

func GenPrivateKey

func GenPrivateKey() string

GenPrivateKey generate a new private key using the command wg

func GenPublicKey

func GenPublicKey(privateKey string) string

GenPublicKey generate a new private key using the command wg

func SyncPeerConf

func SyncPeerConf(inter string, fileName string) error

SyncPeerConf will sync the peer configuration file with the interface file

Types

type ClientConfig

type ClientConfig struct {
	Interface ClientInterface // Client Interface specification
	Peer      ClientPeer      // Client Peer specificiation
}

ClientConfig is the WireGuard Client Configuration specification

type ClientInterface

type ClientInterface struct {
	PrivateKey string // Client Private Key
	Address    string // Client Virtual Private IP
	DNS        string // DNS Server
}

ClientInterface is the WireGuard Client Interface specification

type ClientPeer

type ClientPeer struct {
	PublicKey  string // Server Public Key
	Endpoint   string // Server Endpoint
	AllowedIPs string // IP ranges routed to the VPN
	KeepAlive  uint32 // Seconds between each keep alive
}

ClientPeer is the WireGuard Client Peer specification

type ServerConfig

type ServerConfig struct {
	Interface ServerInterface
	Peers     []ServerPeer
}

ServerConfig is the WireGuard Server Configuration specification

type ServerInterface

type ServerInterface struct {
	PrivateKey string
	PublicKey  string
	Address    string
	SaveConfig bool
	ListenPort uint32
}

ServerInterface is the WireGuard Server Interface specification

type ServerPeer

type ServerPeer struct {
	PublicKey  string
	AllowedIPs string
}

ServerPeer is the WireGuard Server Peer specification

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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