Documentation
¶
Index ¶
- Constants
- Variables
- func Close() error
- func CloseWithUserspace() error
- func Configure(iface string, privateKey string) error
- func Create(iface string, address string) error
- func CreateWithKernel(iface string, address string) error
- func CreateWithUserspace(iface string, address string) error
- func Exists(iface string) (*bool, error)
- func GetListenPort(iface string) (*int, error)
- func RemovePeer(iface string, peerKey string) error
- func UpdatePeer(iface string, peerKey string, allowedIps string, keepAlive time.Duration, ...) error
- func UpdatePeerEndpoint(iface string, peerKey string, newEndpoint string) error
- func WireguardModExists() bool
Constants ¶
const WgInterfaceDefault = "wt0"
WgInterfaceDefault is a default interface name of libdraco
Variables ¶
var (
// todo check after move the WgPort constant to the client
WgPort = 51820
)
Functions ¶
func Configure ¶
Configure configures a Wireguard interface The interface must exist before calling this method (e.g. call interface.Create() before)
func Create ¶
Create Creates a new Wireguard interface, sets a given IP and brings it up. Will reuse an existing one.
func CreateWithKernel ¶
CreateWithKernel Creates a new Wireguard interface using kernel Wireguard module. Works for Linux and offers much better network performance
func CreateWithUserspace ¶
CreateWithUserspace Creates a new Wireguard interface, using wireguard-go userspace implementation
func GetListenPort ¶
GetListenPort returns the listening port of the Wireguard endpoint
func RemovePeer ¶
RemovePeer removes a Wireguard Peer from the interface iface
func UpdatePeer ¶
func UpdatePeer(iface string, peerKey string, allowedIps string, keepAlive time.Duration, endpoint string) error
UpdatePeer updates existing Wireguard Peer or creates a new one if doesn't exist Endpoint is optional
func UpdatePeerEndpoint ¶
UpdatePeerEndpoint updates a Wireguard interface Peer with the new endpoint Used when NAT hole punching was successful and an update of the remote peer endpoint is required
func WireguardModExists ¶
func WireguardModExists() bool
WireguardModExists returns true if Wireguard kernel module exists.
Types ¶
This section is empty.