Added ability to query the JSON data store

This commit is contained in:
Tim Beatham
2023-10-30 19:02:28 +00:00
parent 579426e32d
commit e56780fdd4
9 changed files with 56 additions and 19 deletions

View File

@ -4,13 +4,12 @@ import (
"github.com/tim-beatham/wgmesh/pkg/conf"
"github.com/tim-beatham/wgmesh/pkg/conn"
"github.com/tim-beatham/wgmesh/pkg/mesh"
"github.com/tim-beatham/wgmesh/pkg/query"
"golang.zx2c4.com/wireguard/wgctrl"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
)
/*
* Represents a WireGuard node
*/
// Represents a WireGuard MeshNode
type MeshNode struct {
HostEndpoint string
WgEndpoint string
@ -20,19 +19,18 @@ type MeshNode struct {
Routes []string
}
// Represents a WireGuard Mesh
type Mesh struct {
SharedKey *wgtypes.Key
Nodes map[string]MeshNode
}
/*
* Defines the mesh control server this node
* is running
*/
// Represents a ctrlserver to be used in WireGuard
type MeshCtrlServer struct {
Client *wgctrl.Client
MeshManager *mesh.MeshManager
ConnectionManager conn.ConnectionManager
ConnectionServer *conn.ConnectionServer
Conf *conf.WgMeshConfiguration
Querier query.Querier
}