20 lines
572 B
Go
20 lines
572 B
Go
package peer
|
|
|
|
import (
|
|
"net/netip"
|
|
|
|
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
|
|
)
|
|
|
|
// WGDevice is the subset of wginterface.Device used by App.
|
|
type WGDevice interface {
|
|
Name() string
|
|
Peers() ([]wgtypes.Peer, error)
|
|
AddPeer(pubKey wgtypes.Key) error
|
|
AddDirect(pubKey wgtypes.Key, endpoint netip.AddrPort, vpnIP netip.Addr) error
|
|
SetRelay(pubKey wgtypes.Key, endpoint netip.AddrPort, network netip.Prefix) error
|
|
AddProbe(pubKey wgtypes.Key, endpoint netip.AddrPort) error
|
|
Promote(pubKey wgtypes.Key, vpnIP netip.Addr) error
|
|
RemovePeer(pubKey wgtypes.Key) error
|
|
}
|