Skip to content
Snippets Groups Projects
Verified Commit 17f66f35 authored by André Sterba's avatar André Sterba
Browse files

Remove networkDomain interfaces and move to ports and model

parent 2ddc0efc
No related branches found
No related tags found
1 merge request!557Draft: Refactor nucleus to remove hard dependencies on structs
Pipeline #163359 failed
package networkdomain
// // Service describes an interface for PND service implementation.
// type Service interface {
// Add(NetworkDomain) error
// Delete(NetworkDomain) error
// Get(model.Query) (NetworkDomain, error)
// GetAll() ([]NetworkDomain, error)
// // Note: Implement these in case we want to use cSBI again.
// // PendingChannels(id uuid.UUID, parseErrors ...error) (chan model.Details, error)
// // AddPendingChannel(id uuid.UUID, ch chan model.Details)
// // RemovePendingChannel(id uuid.UUID)
// }
package networkdomain
// // PndStore describes an interface for pnd store implementations.
// type PndStore interface {
// Add(NetworkDomain) error
// Delete(NetworkDomain) error
// Get(model.Query) (LoadedPnd, error)
// GetAll() ([]LoadedPnd, error)
// PendingChannels(id uuid.UUID, parseErrors ...error) (chan Details, error)
// AddPendingChannel(id uuid.UUID, ch chan Details)
// RemovePendingChannel(id uuid.UUID)
// }
// type Details struct {
// ID string
// Address string
// TransportOption *tpb.TransportOption
// }
...@@ -3,8 +3,6 @@ package model ...@@ -3,8 +3,6 @@ package model
import ( import (
"go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson"
"code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkdomain"
"github.com/google/uuid" "github.com/google/uuid"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
) )
...@@ -25,7 +23,7 @@ type LoadedPnd struct { ...@@ -25,7 +23,7 @@ type LoadedPnd struct {
} }
// NewPNDEntity creates a PND object as it is stored in the storage. // NewPNDEntity creates a PND object as it is stored in the storage.
func NewPND(pndID uuid.UUID, name string, description string) networkdomain.NetworkDomain { func NewPND(pndID uuid.UUID, name string, description string) NetworkDomain {
pnd := &pndImplementation{ pnd := &pndImplementation{
Id: pndID, Id: pndID,
Name: name, Name: name,
......
package networkdomain package ports
import ( import "github.com/google/uuid"
"github.com/google/uuid"
)
// NetworkDomain provides an interface for network domain implementations // NetworkDomain provides an interface for network domain implementations
// like principal network domain or logical network domain. // like principal network domain or logical network domain.
...@@ -11,10 +9,3 @@ type NetworkDomain interface { ...@@ -11,10 +9,3 @@ type NetworkDomain interface {
GetDescription() string GetDescription() string
ID() uuid.UUID ID() uuid.UUID
} }
// LoadedPnd represents a PND that was loaded.
type LoadedPnd struct {
ID string `json:"id" bson:"_id,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment