Documentation ¶
Index ¶
- type WGCtrl
- func (w *WGCtrl) ConnFor(node key.NodePublic) types.UDPConn
- func (w *WGCtrl) Controller(privateKey key.NodePrivate, addr4, addr6 netip.Prefix) (toversok.WireGuardController, error)
- func (w *WGCtrl) GetStats(publicKey key.NodePublic) (*toversok.WGStats, error)
- func (w *WGCtrl) RemovePeer(publicKey key.NodePublic) error
- func (w *WGCtrl) Reset() error
- func (w *WGCtrl) UpdatePeer(publicKey key.NodePublic, cfg toversok.PeerCfg) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WGCtrl ¶
type WGCtrl struct {
// contains filtered or unexported fields
}
WGCtrl is a toversok.WireGuardController implementation that takes a preconfigured `client`-tool compatible interface and interacts with it.
On macos, run: - sudo wireguard-go utun - sudo chown $USER /var/run/wireguard/utun* - wg show
To shut down the socket, run: - sudo rm /var/run/wireguard/utun*
func (*WGCtrl) Controller ¶
func (w *WGCtrl) Controller(privateKey key.NodePrivate, addr4, addr6 netip.Prefix) (toversok.WireGuardController, error)
func (*WGCtrl) RemovePeer ¶
func (w *WGCtrl) RemovePeer(publicKey key.NodePublic) error
func (*WGCtrl) UpdatePeer ¶
Click to show internal directories.
Click to hide internal directories.