Skip to content
Snippets Groups Projects

"Overhaul Architecture"

Merged Ghost User requested to merge 67-overhaul-architecture into develop
2 files
+ 11
3
Compare changes
  • Side-by-side
  • Inline
Files
2
  • a1b198fd
    changed GetDevices to GetDevice · a1b198fd
    Malte Bauch authored
    there was no need to get the full device list. but for the cli there is
    a need to access specific devices from the pnd via their uuid
@@ -17,7 +17,7 @@ type PrincipalNetworkDomain interface {
RequestAll(string) error
GetName() string
GetDescription() string
GetDevices() map[uuid.UUID]*Device
GetDevice(uuid.UUID) (*Device, bool)
GetSBIs() map[string]SouthboundInterface
}
@@ -45,8 +45,8 @@ func (pnd *pndImplementation) GetName() string {
return pnd.name
}
func (pnd *pndImplementation) GetDevices() map[uuid.UUID]*Device {
return pnd.devices
func (pnd *pndImplementation) GetDevice(uuid uuid.UUID) (*Device, bool) {
return pnd.getDevice(uuid)
}
func (pnd *pndImplementation) GetDescription() string {
@@ -104,6 +104,11 @@ func (pnd *pndImplementation) removeDevice(uuid uuid.UUID) error {
return nil
}
func (pnd *pndImplementation) getDevice(uuid uuid.UUID) (*Device, bool) {
device, exists := pnd.devices[uuid]
return device, exists
}
func (pnd *pndImplementation) Request(uuid uuid.UUID, path string) error {
d := pnd.devices[uuid]
ctx := context.Background()
Loading