Created join-mesh, list-meshes command

This commit is contained in:
Tim Beatham
2023-09-19 13:45:49 +01:00
parent b679b7fb6e
commit 86756903c7
10 changed files with 179 additions and 72 deletions

View File

@ -1,16 +1,23 @@
package ctrlserver
import "github.com/gin-gonic/gin"
import (
"golang.zx2c4.com/wireguard/wgctrl"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
)
/*
* Represents a WireGuard node
*/
type MeshNode struct {
Host string
CtrlPort string
WgPort string
WgHost string
GinServer gin.Engine
Host string
CtrlPort string
WgPort string
WgHost string
}
type Mesh struct {
SharedKey *wgtypes.Key
Nodes map[string]MeshNode
}
/*
@ -20,5 +27,6 @@ type MeshNode struct {
type MeshCtrlServer struct {
Host string
Port int
Meshes map[string]MeshNode
Client *wgctrl.Client
Meshes map[string]Mesh
}