keksvpn/vendor/golang.zx2c4.com/wireguard/wgctrl/os_windows.go
2022-02-27 04:22:11 +01:00

27 lines
608 B
Go

//go:build windows
// +build windows
package wgctrl
import (
"golang.zx2c4.com/wireguard/wgctrl/internal/wginternal"
"golang.zx2c4.com/wireguard/wgctrl/internal/wguser"
"golang.zx2c4.com/wireguard/wgctrl/internal/wgwindows"
)
// newClients configures wginternal.Clients for Windows systems.
func newClients() ([]wginternal.Client, error) {
var clients []wginternal.Client
// Windows has an in-kernel WireGuard implementation.
kc := wgwindows.New()
clients = append(clients, kc)
uc, err := wguser.New()
if err != nil {
return nil, err
}
clients = append(clients, uc)
return clients, nil
}