keksvpn/vendor/golang.zx2c4.com/wireguard/wgctrl/os_windows.go

28 lines
608 B
Go
Raw Permalink Normal View History

2022-02-27 03:22:11 +00:00
//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
}