Skip to content
Snippets Groups Projects
Commit 52013a12 authored by Fabian Seidl's avatar Fabian Seidl
Browse files

linter pleasing

parent 9b3a32c8
No related branches found
No related tags found
1 merge request!416Resolve "Refactor how PNDs are implemented in the code"
Pipeline #137711 failed
......@@ -5,7 +5,6 @@ import (
"os"
"sync"
cpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/csbi"
"code.fbi.h-da.de/danet/gosdn/controller/customerrs"
"code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkdomain"
"code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement"
......@@ -13,18 +12,15 @@ import (
"code.fbi.h-da.de/danet/gosdn/controller/store"
"github.com/google/uuid"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)
// FilesystemPndStore provides a filesystem implementation for a pnd store.
type FilesystemPndStore struct {
pendingChannels map[uuid.UUID]chan networkelement.Details
pluginService plugin.Service
csbiClient cpb.CsbiServiceClient
pathToPndFile string
fileMutex sync.Mutex
// csbiClient cpb.CsbiServiceClient
pathToPndFile string
fileMutex sync.Mutex
}
// NewFilesystemPndStore returns a filesystem implementation for a pnd store.
......@@ -197,26 +193,26 @@ func (t *FilesystemPndStore) RemovePendingChannel(id uuid.UUID) {
delete(t.pendingChannels, id)
}
func (t *FilesystemPndStore) callback(id uuid.UUID, ch chan networkelement.Details) {
if ch != nil {
t.AddPendingChannel(id, ch)
log.Infof("pending channel %v added", id)
} else {
t.RemovePendingChannel(id)
log.Infof("pending channel %v removed", id)
}
}
func (t *FilesystemPndStore) getCsbiClient() (cpb.CsbiServiceClient, error) {
if t.csbiClient == nil {
orchestrator := viper.GetString("csbi-orchestrator")
conn, err := grpc.Dial(orchestrator, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
return nil, err
}
t.csbiClient = cpb.NewCsbiServiceClient(conn)
}
return t.csbiClient, nil
}
// func (t *FilesystemPndStore) callback(id uuid.UUID, ch chan networkelement.Details) {
// if ch != nil {
// t.AddPendingChannel(id, ch)
// log.Infof("pending channel %v added", id)
// } else {
// t.RemovePendingChannel(id)
// log.Infof("pending channel %v removed", id)
// }
// }
// func (t *FilesystemPndStore) getCsbiClient() (cpb.CsbiServiceClient, error) {
// if t.csbiClient == nil {
// orchestrator := viper.GetString("csbi-orchestrator")
// conn, err := grpc.Dial(orchestrator, grpc.WithTransportCredentials(insecure.NewCredentials()))
// if err != nil {
// return nil, err
// }
// t.csbiClient = cpb.NewCsbiServiceClient(conn)
// }
// return t.csbiClient, nil
// }
......@@ -3,10 +3,7 @@ package nucleus
import (
"go.mongodb.org/mongo-driver/bson"
cpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/csbi"
"code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkdomain"
"code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement"
"github.com/google/uuid"
log "github.com/sirupsen/logrus"
......@@ -49,8 +46,8 @@ type pndImplementation struct {
//nolint
Id uuid.UUID `json:"id,omitempty"`
csbiClient cpb.CsbiServiceClient
callback func(uuid.UUID, chan networkelement.Details)
// csbiClient cpb.CsbiServiceClient
// callback func(uuid.UUID, chan networkelement.Details)
}
func (pnd *pndImplementation) ID() uuid.UUID {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment