X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=sdl.go;h=51cfb93d07ffa9f24746595f880a8c382c3c4de6;hb=refs%2Fchanges%2F62%2F6062%2F1;hp=afc4781a966a36fc9f059541b465ba62745b32ac;hpb=725e2204f7256de05686d380b4e30a72e9dea8b4;p=ric-plt%2Fsdlgo.git diff --git a/sdl.go b/sdl.go index afc4781..51cfb93 100644 --- a/sdl.go +++ b/sdl.go @@ -23,9 +23,8 @@ package sdlgo import ( - "time" - "gerrit.o-ran-sc.org/r/ric-plt/sdlgo/internal/sdlgoredis" + "time" ) //SdlInstance provides an API to read, write and modify @@ -40,7 +39,7 @@ type SdlInstance struct { //can use this exported data type to locally store a reference to database //instance returned from NewDabase() function. type Database struct { - instance iDatabase + instances []iDatabase } //NewDatabase creates a connection to database that will be used @@ -48,9 +47,11 @@ type Database struct { //can be reused between multiple SDL instances in which case each instance //is using the same connection. func NewDatabase() *Database { - return &Database{ - instance: sdlgoredis.Create(), + db := &Database{} + for _, v := range sdlgoredis.Create() { + db.instances = append(db.instances, v) } + return db } //NewSdlInstance creates a new sdl instance using the given namespace.