mirror of
https://github.com/h44z/wg-portal.git
synced 2026-12-05 11:46:09 +01:00
24 lines
550 B
Go
24 lines
550 B
Go
package lowlevel
|
|
|
|
import (
|
|
"io"
|
|
|
|
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
|
|
|
|
"github.com/h44z/wg-portal/internal/domain"
|
|
)
|
|
|
|
// A WireGuardClient is a type which can control a WireGuard device.
|
|
type WireGuardClient interface {
|
|
io.Closer
|
|
Devices() ([]*wgtypes.Device, error)
|
|
Device(name string) (*wgtypes.Device, error)
|
|
ConfigureDevice(name string, cfg wgtypes.Config) error
|
|
}
|
|
|
|
// WireGuardDevice carries the device and its backend options from the same read.
|
|
type WireGuardDevice struct {
|
|
*wgtypes.Device
|
|
AmneziaWG domain.AmneziaWGOptions
|
|
}
|