Documentation ¶
Index ¶
- Constants
- func WireguardModuleIsLoaded() bool
- type NetInterface
- type WGAddress
- type WGIface
- func (w *WGIface) AddAllowedIP(peerKey string, allowedIP string) error
- func (w *WGIface) Address() WGAddress
- func (w *WGIface) Configure(privateKey string, port int) error
- func (w *WGIface) Name() string
- func (w *WGIface) RemoveAllowedIP(peerKey string, allowedIP string) error
- func (w *WGIface) RemovePeer(peerKey string) error
- func (w *WGIface) UpdateAddr(newAddr string) error
- func (w *WGIface) UpdatePeer(peerKey string, allowedIps string, keepAlive time.Duration, ...) error
Constants ¶
View Source
const ( DefaultMTU = 1280 DefaultWgPort = 51820 )
Variables ¶
This section is empty.
Functions ¶
func WireguardModuleIsLoaded ¶ added in v0.14.0
func WireguardModuleIsLoaded() bool
WireguardModuleIsLoaded check if we can load wireguard mod (linux only)
Types ¶
type NetInterface ¶
type NetInterface interface {
Close() error
}
NetInterface represents a generic network tunnel interface
type WGIface ¶
type WGIface struct {
// contains filtered or unexported fields
}
WGIface represents a interface instance
func NewWGIFace ¶ added in v0.6.3
NewWGIFace Creates a new Wireguard interface instance
func (*WGIface) AddAllowedIP ¶ added in v0.9.0
AddAllowedIP adds a prefix to the allowed IPs list of peer
func (*WGIface) Configure ¶
Configure configures a Wireguard interface The interface must exist before calling this method (e.g. call interface.Create() before)
func (*WGIface) RemoveAllowedIP ¶ added in v0.9.0
RemoveAllowedIP removes a prefix from the allowed IPs list of peer
func (*WGIface) RemovePeer ¶
RemovePeer removes a Wireguard Peer from the interface iface
func (*WGIface) UpdateAddr ¶ added in v0.14.0
UpdateAddr updates address of the interface
Click to show internal directories.
Click to hide internal directories.