mirror of
https://github.com/tim-beatham/smegmesh.git
synced 2025-08-09 13:24:52 +02:00
53-run-commands-pre-up-and-post-down
- Ability to run a command pre up and post down - Ability to be a client in one mesh and a peer in the other - Added dev card to specify different sync rate, keepalive rate per mesh.
This commit is contained in:
@ -16,7 +16,7 @@ import (
|
||||
|
||||
// NewCtrlServerParams are the params requried to create a new ctrl server
|
||||
type NewCtrlServerParams struct {
|
||||
Conf *conf.WgMeshConfiguration
|
||||
Conf *conf.DaemonConfiguration
|
||||
Client *wgctrl.Client
|
||||
CtrlProvider rpc.MeshCtrlServerServer
|
||||
SyncProvider rpc.SyncServiceServer
|
||||
@ -28,7 +28,9 @@ type NewCtrlServerParams struct {
|
||||
// operation failed
|
||||
func NewCtrlServer(params *NewCtrlServerParams) (*MeshCtrlServer, error) {
|
||||
ctrlServer := new(MeshCtrlServer)
|
||||
meshFactory := &crdt.TwoPhaseMapFactory{}
|
||||
meshFactory := &crdt.TwoPhaseMapFactory{
|
||||
Config: params.Conf,
|
||||
}
|
||||
nodeFactory := &crdt.MeshNodeFactory{
|
||||
Config: *params.Conf,
|
||||
}
|
||||
@ -36,7 +38,7 @@ func NewCtrlServer(params *NewCtrlServerParams) (*MeshCtrlServer, error) {
|
||||
ipAllocator := &ip.ULABuilder{}
|
||||
interfaceManipulator := wg.NewWgInterfaceManipulator(params.Client)
|
||||
|
||||
configApplyer := mesh.NewWgMeshConfigApplyer(params.Conf)
|
||||
configApplyer := mesh.NewWgMeshConfigApplyer()
|
||||
|
||||
meshManagerParams := &mesh.NewMeshManagerParams{
|
||||
Conf: *params.Conf,
|
||||
@ -87,7 +89,7 @@ func NewCtrlServer(params *NewCtrlServerParams) (*MeshCtrlServer, error) {
|
||||
return ctrlServer, nil
|
||||
}
|
||||
|
||||
func (s *MeshCtrlServer) GetConfiguration() *conf.WgMeshConfiguration {
|
||||
func (s *MeshCtrlServer) GetConfiguration() *conf.DaemonConfiguration {
|
||||
return s.Conf
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ type Mesh struct {
|
||||
}
|
||||
|
||||
type CtrlServer interface {
|
||||
GetConfiguration() *conf.WgMeshConfiguration
|
||||
GetConfiguration() *conf.DaemonConfiguration
|
||||
GetClient() *wgctrl.Client
|
||||
GetQuerier() query.Querier
|
||||
GetMeshManager() mesh.MeshManager
|
||||
@ -48,6 +48,6 @@ type MeshCtrlServer struct {
|
||||
MeshManager mesh.MeshManager
|
||||
ConnectionManager conn.ConnectionManager
|
||||
ConnectionServer *conn.ConnectionServer
|
||||
Conf *conf.WgMeshConfiguration
|
||||
Conf *conf.DaemonConfiguration
|
||||
Querier query.Querier
|
||||
}
|
||||
|
@ -23,10 +23,10 @@ func NewCtrlServerStub() *CtrlServerStub {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *CtrlServerStub) GetConfiguration() *conf.WgMeshConfiguration {
|
||||
return &conf.WgMeshConfiguration{
|
||||
GrpcPort: "8080",
|
||||
Endpoint: "abc.com",
|
||||
func (c *CtrlServerStub) GetConfiguration() *conf.DaemonConfiguration {
|
||||
return &conf.DaemonConfiguration{
|
||||
GrpcPort: 8080,
|
||||
BaseConfiguration: conf.WgConfiguration{},
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user