1
0
forked from extern/smegmesh
smegmesh/pkg/ctrlserver/ctrltypes.go
Tim Beatham 360f9d3c54 Few refactorings of managing the mesh and a graph
visualisation tool for seeing the state of a mesh.
2023-10-22 13:34:49 +01:00

38 lines
780 B
Go

package ctrlserver
import (
"github.com/tim-beatham/wgmesh/pkg/conf"
"github.com/tim-beatham/wgmesh/pkg/conn"
"github.com/tim-beatham/wgmesh/pkg/mesh"
"golang.zx2c4.com/wireguard/wgctrl"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
)
/*
* Represents a WireGuard node
*/
type MeshNode struct {
HostEndpoint string
WgEndpoint string
PublicKey string
WgHost string
Failed bool
}
type Mesh struct {
SharedKey *wgtypes.Key
Nodes map[string]MeshNode
}
/*
* Defines the mesh control server this node
* is running
*/
type MeshCtrlServer struct {
Client *wgctrl.Client
MeshManager *mesh.MeshManger
ConnectionManager conn.ConnectionManager
ConnectionServer *conn.ConnectionServer
Conf *conf.WgMeshConfiguration
}