"src/syscall/syscall_js.go" did not exist on "438c8f6b531a1cfcb4a084d3090b631938a9839e"
Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package nucleus
import (
"fmt"
spb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/southbound"
"code.fbi.h-da.de/danet/gosdn/controller/interfaces/southbound"
"code.fbi.h-da.de/danet/gosdn/controller/store"
"github.com/google/uuid"
)
const (
sbiStoreName = "sbi"
)
// SbiStore is used to store SouthboundInterfaces
type SbiStore struct {
sbiStoreName string
}
// LoadedSbi represents a Southbound Interface that was loaded by using
// the Load() method of the SbiStore.
type LoadedSbi struct {
ID string `json:"_id" bson:"_id,omitempty"`
Type spb.Type `bson:"type"`
Path string `json:"path,omitempty"`
}
// NewSbiStore returns a sbiStore
func NewSbiStore(pndUUID uuid.UUID) southbound.SbiStore {
storeMode := store.GetStoreMode()
switch storeMode {
case store.Filesystem:
store := NewGenericStore[southbound.SouthboundInterface]()
return &store
case store.Database:
sbiStoreName: fmt.Sprintf("sbi-store-%s.json", pndUUID.String()),
}
case store.Memory:
store := NewGenericStore[southbound.SouthboundInterface]()
return &store
default:
return nil
}
}