Skip to content
Snippets Groups Projects

"Overhaul Architecture"

Merged Ghost User requested to merge 67-overhaul-architecture into develop
1 file
+ 5
0
Compare changes
  • Side-by-side
  • Inline
+ 5
0
@@ -166,6 +166,7 @@ func (s *server) CreatePND(ctx context.Context, in *pb.CreatePNDRequest) (*pb.Cr
}
func (s *server) GetAllPNDs(ctx context.Context, in *emptypb.Empty) (*pb.AllPNDsReply, error) {
log.Info("Received: Get all PNDs")
var pnds []*pb.PND
for uuidPND, pnd := range s.core.principalNetworkDomains {
var devices []*pb.Device
@@ -189,6 +190,7 @@ func (s *server) GetAllPNDs(ctx context.Context, in *emptypb.Empty) (*pb.AllPNDs
}
func (s *server) AddDevice(ctx context.Context, in *pb.AddDeviceRequest) (*pb.AddDeviceReply, error) {
path := viper.GetString("pnd.path")
uuidPND, err := uuid.Parse(in.UuidPND)
pnd := s.core.principalNetworkDomains[uuidPND]
@@ -204,5 +206,8 @@ func (s *server) AddDevice(ctx context.Context, in *pb.AddDeviceRequest) (*pb.Ad
}
devicesMap := pnd.(*pndImplementation).Devices
devicesMap[newDevice.Uuid] = newDevice
if err := s.core.savePNDs(path); err != nil {
log.Info(err)
}
return &pb.AddDeviceReply{Message: "Added new Device: " + newDevice.Uuid.String()}, err
}
Loading