test
This commit is contained in:
commit
347b902cf0
2 changed files with 37 additions and 0 deletions
11
Readme.md
Normal file
11
Readme.md
Normal file
|
@ -0,0 +1,11 @@
|
|||
#GoWgPKG
|
||||
|
||||
git.keks.cloud/kekskurse/gowgpkg
|
||||
|
||||
Go Package to configure Wireguard on Linux
|
||||
|
||||
* Create Devices
|
||||
* Configure Device
|
||||
* Create Wireguard
|
||||
* Configure wireguard
|
||||
* Provides Structs with all needed information
|
26
devices.go
Normal file
26
devices.go
Normal file
|
@ -0,0 +1,26 @@
|
|||
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
|
||||
}
|
Loading…
Reference in a new issue