Skip to content
Snippets Groups Projects
sbiStore.go 520 B
Newer Older
  • Learn to ignore specific revisions
  • package nucleus
    
    import (
    	"fmt"
    
    	"code.fbi.h-da.de/danet/gosdn/controller/interfaces/southbound"
    	"code.fbi.h-da.de/danet/gosdn/controller/store"
    
    	"github.com/google/uuid"
    )
    
    
    // NewSbiStore returns a sbiStore.
    
    func NewSbiStore(pndUUID uuid.UUID) southbound.Store {
    
    	storeMode := store.GetStoreMode()
    
    	switch storeMode {
    	case store.Database:
    
    		return &DatabaseSbiStore{
    
    			sbiStoreName: fmt.Sprintf("sbi-store-%s.json", pndUUID.String()),
    		}
    
    	default:
    
    		store := NewFilesystemSbiStore(pndUUID)
    		return store