wireguard

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2022 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const WgConfigTemplate = `` /* 732-byte string literal not displayed */

Variables

This section is empty.

Functions

func ConfigureWireguard added in v0.2.0

func ConfigureWireguard(wgConfig Configuration) ([]byte, error)

func InitWgKeys added in v0.2.0

func InitWgKeys(wgInterfaceConfigFolder string) (string, string, error)

Types

type Configuration added in v0.2.0

type Configuration struct {
	Interface Interface
	Peers     []Peer
}

type Interface

type Interface struct {
	Name       string
	Address    string //can be /32 IP or /24 subnet in case of Relay server
	ListenPort int
	PublicKey  string
	PrivateKey string
	PostUp     string
	PostDown   string
}

func (Interface) IsRelay added in v0.2.0

func (i Interface) IsRelay() bool

type Peer added in v0.2.0

type Peer struct {
	PublicKey    string
	IP           net.IP
	EndpointIP   net.IP
	EndpointPort int
	AllowedIPs   string
}

func (Peer) GetEndpointIP added in v0.2.0

func (p Peer) GetEndpointIP() string

func (Peer) GetIP added in v0.2.0

func (p Peer) GetIP() string

func (Peer) HasSameEndpointIP added in v0.2.0

func (p Peer) HasSameEndpointIP(wgEndpointIp string) bool

func (Peer) IsClient added in v0.2.0

func (p Peer) IsClient() bool

func (Peer) IsEndpointIPDefined added in v0.2.0

func (p Peer) IsEndpointIPDefined() bool

func (Peer) String added in v0.2.0

func (p Peer) String() string

Jump to

Keyboard shortcuts

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