Documentation ¶
Index ¶
- Constants
- func Exists(iface string) (*bool, error)
- func WireguardModExists() bool
- type NativeLink
- type NetInterface
- type WGAddress
- type WGIface
- func (w *WGIface) Close() error
- func (w *WGIface) Configure(privateKey string, port int) error
- func (w *WGIface) Create() error
- func (w *WGIface) CreateWithKernel() error
- func (w *WGIface) CreateWithUserspace() error
- func (w *WGIface) GetListenPort() (*int, error)
- func (w *WGIface) RemovePeer(peerKey string) error
- func (w *WGIface) UpdatePeer(peerKey string, allowedIps string, keepAlive time.Duration, ...) error
Constants ¶
const ( DefaultMTU = 1280 DefaultWgPort = 51820 )
const WgInterfaceDefault = "wt0"
WgInterfaceDefault is a default interface name of Wiretrustee
Variables ¶
This section is empty.
Functions ¶
func WireguardModExists ¶
func WireguardModExists() bool
Types ¶
type NativeLink ¶
type NetInterface ¶
type NetInterface interface {
Close() error
}
NetInterface represents a generic network tunnel interface
type WGIface ¶
type WGIface struct { Name string Port int MTU int Address WGAddress Interface NetInterface }
WGIface represents a interface instance
func NewWGIface ¶
NewWGIface Creates a new Wireguard interface instance
func (*WGIface) Configure ¶
Configure configures a Wireguard interface The interface must exist before calling this method (e.g. call interface.Create() before)
func (*WGIface) Create ¶
Create Creates a new Wireguard interface, sets a given IP and brings it up. Will reuse an existing one.
func (*WGIface) CreateWithKernel ¶
CreateWithKernel Creates a new Wireguard interface using kernel Wireguard module. Works for Linux and offers much better network performance
func (*WGIface) CreateWithUserspace ¶
CreateWithUserspace Creates a new Wireguard interface, using wireguard-go userspace implementation
func (*WGIface) GetListenPort ¶
GetListenPort returns the listening port of the Wireguard endpoint
func (*WGIface) RemovePeer ¶
RemovePeer removes a Wireguard Peer from the interface iface