Skip to content
Snippets Groups Projects

"Overhaul Architecture"

Merged Ghost User requested to merge 67-overhaul-architecture into develop
3 files
+ 26
14
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 4
6
@@ -8,7 +8,6 @@ package nucleus
import (
"context"
"encoding/json"
"errors"
"io"
"net"
@@ -261,9 +260,8 @@ func (s *server) HandleDeviceGetRequest(ctx context.Context, in *pb.DeviceGetReq
log.Info(err)
return &pb.DeviceGetReply{Message: err.Error()}, err
}
//the specific device a request will be sent to
device, exists := s.core.principalNetworkDomains[uuidPND].GetDevice(uuidDevice)
if exists != true {
//check if the device exists
if !pnd.ContainsDevice(uuidDevice) {
err := errors.New("Couldnt find device: UUID is wrong")
log.Info(err)
return &pb.DeviceGetReply{Message: err.Error()}, err
@@ -276,11 +274,11 @@ func (s *server) HandleDeviceGetRequest(ctx context.Context, in *pb.DeviceGetReq
return &pb.DeviceGetReply{Message: err.Error()}, err
}
d, err := json.MarshalIndent(device, "", "\t")
d, err := pnd.MarshalDevice(uuidDevice)
if err != nil {
log.Info(err)
return &pb.DeviceGetReply{Message: err.Error()}, err
}
return &pb.DeviceGetReply{Message: string(string(d))}, nil
return &pb.DeviceGetReply{Message: d}, nil
}
Loading