Skip to content
Snippets Groups Projects
Commit 91f9af6e authored by Manuel Kieweg's avatar Manuel Kieweg
Browse files

Interface and implementation stubs

parent c02df12d
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
Pipeline #54454 passed
This commit is part of merge request !85. Comments created here will be created in the context of that merge request.
package interfaces
// Client provides an interface for
// SBI protocol clients
type Client interface {
GetConfig() ClientConfig
}
package interfaces
// Port provides an interface for
// the device's ports
type Port interface {
}
// Client provides an interface for
// SBI client implementations
type Client interface {
GetConfig() ClientConfig
ListPorts() map[int]Port
PushReceiver() error
}
// PrincipalNetworkDomain provides an
// interface for PND implementations
type PrincipalNetworkDomain interface {
Destroy() error
AddSbi() error
RemoveSbi() error
}
// SouthboundInterface provides an
// interface for SBI implementations
type SouthboundInterface interface {
AddClient() error
RemoveClient() error
CollectHeartbeats() error
ListClients() map[int]Client
}
package nucleus
type pndImplementation struct {
}
// Interface satisfaction
func (pnd *pndImplementation) Destroy() error {
return destroy()
}
func (pnd *pndImplementation) AddSbi() error {
return addSbi()
}
func (pnd *pndImplementation) RemoveSbi() error {
return removeSbi()
}
// Actual implementation, bind to struct if
// neccessary
func destroy() error {
return nil
}
func addSbi() error {
return nil
}
func removeSbi() error {
return nil
}
...@@ -29,6 +29,18 @@ func (c MCPClient) GetConfig() interfaces.ClientConfig { ...@@ -29,6 +29,18 @@ func (c MCPClient) GetConfig() interfaces.ClientConfig {
return *c.config return *c.config
} }
// ListPorts is a stub to satisfy the interface
// TODO: Implement
func (c MCPClient) ListPorts() map[int]interfaces.Port {
return nil
}
// PushReceiver is a stub to satisfy the interface
// TODO: Implement
func (c MCPClient) PushReceiver() error {
return nil
}
//NewMCPClient creates a Ciena flavores TAPI client //NewMCPClient creates a Ciena flavores TAPI client
func NewMCPClient(endpoint, username, password string, database *database.Database, config *interfaces.ClientConfig) *MCPClient { func NewMCPClient(endpoint, username, password string, database *database.Database, config *interfaces.ClientConfig) *MCPClient {
// create the transport // create the transport
......
package restconf
type southboundInterface struct {
}
// Interface satisfaction
func (sbi *southboundInterface) AddClient() error {
return addClient()
}
func (sbi *southboundInterface) RemoveClient() error {
return removeClient()
}
func (sbi *southboundInterface) CollectHeartbeats() error {
return collectHeartbeats()
}
func (sbi *southboundInterface) ListClients() error {
return listClients()
}
// Actual implementation, bind to struct if
// neccessary
func addClient() error {
return nil
}
func removeClient() error {
return nil
}
func collectHeartbeats() error {
return nil
}
func listClients() error {
return nil
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment