Skip to content
Snippets Groups Projects
server.go 880 B
Newer Older
  • Learn to ignore specific revisions
  • Manuel Kieweg's avatar
    Manuel Kieweg committed
    package server
    
    import (
    	pb "code.fbi.h-da.de/cocsn/api/proto/gosdn"
    	"code.fbi.h-da.de/cocsn/gosdn/nucleus"
    	"context"
    	"sync"
    )
    
    var pndLock sync.RWMutex
    var sbiLock sync.RWMutex
    var pndc *nucleus.PndStore
    var sbic *nucleus.SbiStore
    
    type gosdnServer struct {
    	pb.UnimplementedGosdnServer
    }
    
    func (s gosdnServer) Get(ctx context.Context, request *pb.GetRequest) (*pb.GetResponse, error) {
    	panic("implement me")
    }
    
    func (s gosdnServer) Set(ctx context.Context, request *pb.SetRequest) (*pb.SetResponse, error) {
    	panic("implement me")
    }
    
    func NewNBI(pnds *nucleus.PndStore, sbis *nucleus.SbiStore) *NorthboundInterface {
    	pndc = pnds
    	sbic = sbis
    	pndLock = sync.RWMutex{}
    	sbiLock = sync.RWMutex{}
    	return &NorthboundInterface{
    		Pnd:        &pndServer{},
    		Controller: &gosdnServer{},
    	}
    }
    
    type NorthboundInterface struct {
    	Pnd        *pndServer
    	Controller *gosdnServer
    }