2023-10-28 17:38:25 +02:00
|
|
|
package wg
|
|
|
|
|
2023-11-24 13:07:03 +01:00
|
|
|
import "golang.zx2c4.com/wireguard/wgctrl/wgtypes"
|
|
|
|
|
2023-10-28 17:38:25 +02:00
|
|
|
type WgInterfaceManipulator interface {
|
|
|
|
// CreateInterface creates a WireGuard interface
|
2023-11-24 13:07:03 +01:00
|
|
|
CreateInterface(port int, privateKey *wgtypes.Key) (string, error)
|
2023-11-07 20:48:53 +01:00
|
|
|
// AddAddress adds an address to the given interface name
|
|
|
|
AddAddress(ifName string, addr string) error
|
|
|
|
// RemoveInterface removes the specified interface
|
|
|
|
RemoveInterface(ifName string) error
|
2023-10-28 17:38:25 +02:00
|
|
|
}
|
2023-12-22 22:47:56 +01:00
|
|
|
|
|
|
|
type WgError struct {
|
|
|
|
msg string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *WgError) Error() string {
|
|
|
|
return m.msg
|
|
|
|
}
|