26 lines
411 B
Go
26 lines
411 B
Go
|
package gowgpkg
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"golang.zx2c4.com/wireguard/wgctrl"
|
||
|
)
|
||
|
|
||
|
type Device struct {
|
||
|
|
||
|
}
|
||
|
|
||
|
func ListDevices() ([]Device, error) {
|
||
|
client, err := wgctrl.New()
|
||
|
if err != nil {
|
||
|
return nil, fmt.Errorf("Can't create wgctrl Client: %w", err)
|
||
|
}
|
||
|
|
||
|
devices, err := client.Devices()
|
||
|
if err != nil {
|
||
|
return nil, fmt.Errorf("Can't get list of devices: %w", err)
|
||
|
}
|
||
|
|
||
|
fmt.Println(devices)
|
||
|
|
||
|
return nil, nil
|
||
|
}
|