mirror of
https://github.com/tim-beatham/smegmesh.git
synced 2025-08-09 13:24:52 +02:00
Created join-mesh, list-meshes command
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user