2024-01-03 16:06:20 +01:00
|
|
|
package iface
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
|
|
|
|
)
|
|
|
|
|
|
|
|
type wgConfigurer interface {
|
|
|
|
configureInterface(privateKey string, port int) error
|
|
|
|
updatePeer(peerKey string, allowedIps string, keepAlive time.Duration, endpoint *net.UDPAddr, preSharedKey *wgtypes.Key) error
|
|
|
|
removePeer(peerKey string) error
|
|
|
|
addAllowedIP(peerKey string, allowedIP string) error
|
|
|
|
removeAllowedIP(peerKey string, allowedIP string) error
|
|
|
|
close()
|
2024-01-22 12:20:24 +01:00
|
|
|
getStats(peerKey string) (WGStats, error)
|
2024-01-03 16:06:20 +01:00
|
|
|
}
|