Documentation ¶
Index ¶
- func NewPeerConfig(publicKey string, presharedKey string, endpoint string, allowedIPs []string) (*wgtypes.PeerConfig, error)
- func SetPeers(deviceName string, peers []wgtypes.PeerConfig) error
- type Device
- func (d *Device) AddRouteToNet(subnet *net.IPNet) error
- func (d *Device) Configure() error
- func (d *Device) EnsureLinkUp() error
- func (d *Device) FlushAddresses() error
- func (d *Device) ListenPort() int
- func (d *Device) Name() string
- func (d *Device) PublicKey() string
- func (d *Device) Run() error
- func (d *Device) UpdateAddress(address *net.IPNet) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPeerConfig ¶
func NewPeerConfig(publicKey string, presharedKey string, endpoint string, allowedIPs []string) (*wgtypes.PeerConfig, error)
NewPeerConfig constructs and returns a wgtypes PeerConfig object.
Types ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device is the struct to hold the link device and the wireguard attributes we need.
func (*Device) AddRouteToNet ¶
AddRouteToNet adds a route to the passed subnet via the device
func (*Device) EnsureLinkUp ¶
EnsureLinkUp brings up the wireguard device.
func (*Device) FlushAddresses ¶
FlushAddresses deletes all ips from the device network interface
Click to show internal directories.
Click to hide internal directories.