Skip to content
Snippets Groups Projects
Commit 4e2f68cf authored by Malte Bauch's avatar Malte Bauch
Browse files

changed pnd and southbound interface

- added function to create a pnd and a interface
- pnd contains a slice of southbound interfaces
- southbound interface contains a slice of clients
parent 91f9af6e
No related branches found
No related tags found
4 merge requests!90Develop,!88Use SPF Viper for configuration,!85Draft: Resolve "Overhaul Architecture",!53V.0.1.0 Codename Threadbare
package nucleus package nucleus
import "code.fbi.h-da.de/cocsn/gosdn/nucleus/interfaces"
type pndImplementation struct { type pndImplementation struct {
name string
sbiContainer []interfaces.SouthboundInterface
}
//NewPNDImplementation creates a Principle Network Domain
func NewPNDImplementation(name string, sbi ...interfaces.SouthboundInterface) interfaces.PrincipalNetworkDomain {
return &pndImplementation{
name: name,
sbiContainer: sbi,
}
} }
// Interface satisfaction // Interface satisfaction
......
package restconf package restconf
import "code.fbi.h-da.de/cocsn/gosdn/nucleus/interfaces"
type southboundInterface struct { type southboundInterface struct {
name string
clientContainer []interfaces.Client
}
//NewSouthboundInterface creates a Southbound Interface
func NewSouthboundInterface(name string, clients ...interfaces.Client) interfaces.SouthboundInterface {
return &southboundInterface{
name: name,
clientContainer: clients,
}
} }
// Interface satisfaction // Interface satisfaction
...@@ -16,7 +28,7 @@ func (sbi *southboundInterface) CollectHeartbeats() error { ...@@ -16,7 +28,7 @@ func (sbi *southboundInterface) CollectHeartbeats() error {
return collectHeartbeats() return collectHeartbeats()
} }
func (sbi *southboundInterface) ListClients() error { func (sbi *southboundInterface) ListClients() map[int]interfaces.Client {
return listClients() return listClients()
} }
...@@ -34,6 +46,6 @@ func collectHeartbeats() error { ...@@ -34,6 +46,6 @@ func collectHeartbeats() error {
return nil return nil
} }
func listClients() error { func listClients() map[int]interfaces.Client {
return nil return nil
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment