VOL-2154 : Moving back db/model to voltha-go
- Kept backend.go to limit impact in other components
Amendments:
- Removed db/model unit tests
- Forgot to fix some stash merges
- Removed unused "lock" parameter from kv clients
- Changed version for release
Change-Id: I25a03eb335ce22d49412be4bf2cceaff387dc4ae
diff --git a/pkg/techprofile/config.go b/pkg/techprofile/config.go
index 3a45af1..9c64bd8 100644
--- a/pkg/techprofile/config.go
+++ b/pkg/techprofile/config.go
@@ -16,7 +16,7 @@
package techprofile
import (
- "github.com/opencord/voltha-lib-go/v2/pkg/db/model"
+ "github.com/opencord/voltha-lib-go/v2/pkg/db"
)
// tech profile default constants
@@ -83,7 +83,7 @@
KVStorePort int
KVStoreType string
KVStoreTimeout int
- KVBackend *model.Backend
+ KVBackend *db.Backend
TPKVPathPrefix string
TPFileKVPath string
TPInstanceKVPath string
diff --git a/pkg/techprofile/tech_profile.go b/pkg/techprofile/tech_profile.go
index ea7b36a..92569f0 100644
--- a/pkg/techprofile/tech_profile.go
+++ b/pkg/techprofile/tech_profile.go
@@ -22,8 +22,8 @@
"fmt"
"strconv"
+ "github.com/opencord/voltha-lib-go/v2/pkg/db"
"github.com/opencord/voltha-lib-go/v2/pkg/db/kvstore"
- "github.com/opencord/voltha-lib-go/v2/pkg/db/model"
"github.com/opencord/voltha-lib-go/v2/pkg/log"
tp_pb "github.com/opencord/voltha-protos/v2/go/tech_profile"
)
@@ -226,7 +226,7 @@
DownstreamGemPortAttributeList []iGemPortAttribute `json:"downstream_gem_port_attribute_list"`
}
-func (t *TechProfileMgr) SetKVClient() *model.Backend {
+func (t *TechProfileMgr) SetKVClient() *db.Backend {
addr := t.config.KVStoreHost + ":" + strconv.Itoa(t.config.KVStorePort)
kvClient, err := newKVClient(t.config.KVStoreType, addr, t.config.KVStoreTimeout)
if err != nil {
@@ -238,7 +238,7 @@
})
return nil
}
- return &model.Backend{
+ return &db.Backend{
Client: kvClient,
StoreType: t.config.KVStoreType,
Host: t.config.KVStoreHost,
diff --git a/pkg/techprofile/tech_profile_if.go b/pkg/techprofile/tech_profile_if.go
index 0904d7e..3267759 100644
--- a/pkg/techprofile/tech_profile_if.go
+++ b/pkg/techprofile/tech_profile_if.go
@@ -17,12 +17,12 @@
package techprofile
import (
- "github.com/opencord/voltha-lib-go/v2/pkg/db/model"
+ "github.com/opencord/voltha-lib-go/v2/pkg/db"
tp_pb "github.com/opencord/voltha-protos/v2/go/tech_profile"
)
type TechProfileIf interface {
- SetKVClient() *model.Backend
+ SetKVClient() *db.Backend
GetTechProfileInstanceKVPath(techProfiletblID uint32, uniPortName string) string
GetTPInstanceFromKVStore(techProfiletblID uint32, path string) (*TechProfile, error)
CreateTechProfInstance(techProfiletblID uint32, uniPortName string, intfId uint32) *TechProfile