diff --git a/accounts/pkg/indexer/index/non_unique.go b/accounts/pkg/indexer/index/disk/non_unique.go similarity index 99% rename from accounts/pkg/indexer/index/non_unique.go rename to accounts/pkg/indexer/index/disk/non_unique.go index c758daa71..d3194043c 100644 --- a/accounts/pkg/indexer/index/non_unique.go +++ b/accounts/pkg/indexer/index/disk/non_unique.go @@ -1,4 +1,4 @@ -package index +package disk import ( "errors" diff --git a/accounts/pkg/indexer/index/non_unique_test.go b/accounts/pkg/indexer/index/disk/non_unique_test.go similarity index 95% rename from accounts/pkg/indexer/index/non_unique_test.go rename to accounts/pkg/indexer/index/disk/non_unique_test.go index c9dc9bfd3..4eb5c42e0 100644 --- a/accounts/pkg/indexer/index/non_unique_test.go +++ b/accounts/pkg/indexer/index/disk/non_unique_test.go @@ -1,7 +1,8 @@ -package index +package disk import ( "github.com/owncloud/ocis/accounts/pkg/indexer/errors" + "github.com/owncloud/ocis/accounts/pkg/indexer/index" . "github.com/owncloud/ocis/accounts/pkg/indexer/test" "github.com/stretchr/testify/assert" "os" @@ -89,7 +90,7 @@ func TestNonUniqueIndexSearch(t *testing.T) { _ = os.RemoveAll(dataPath) } -func getNonUniqueIdxSut(t *testing.T) (sut Index, dataPath string) { +func getNonUniqueIdxSut(t *testing.T) (sut index.Index, dataPath string) { dataPath = WriteIndexTestData(t, TestData, "Id") sut = NewNonUniqueIndex("Pet", "Color", path.Join(dataPath, "pets"), path.Join(dataPath, "index.disk")) err := sut.Init() diff --git a/accounts/pkg/indexer/index/unique.go b/accounts/pkg/indexer/index/disk/unique.go similarity index 99% rename from accounts/pkg/indexer/index/unique.go rename to accounts/pkg/indexer/index/disk/unique.go index 70696d4e9..7cb78766f 100644 --- a/accounts/pkg/indexer/index/unique.go +++ b/accounts/pkg/indexer/index/disk/unique.go @@ -1,4 +1,4 @@ -package index +package disk import ( "errors" diff --git a/accounts/pkg/indexer/index/unique_test.go b/accounts/pkg/indexer/index/disk/unique_test.go similarity index 96% rename from accounts/pkg/indexer/index/unique_test.go rename to accounts/pkg/indexer/index/disk/unique_test.go index 5c153a8aa..ee47d4597 100644 --- a/accounts/pkg/indexer/index/unique_test.go +++ b/accounts/pkg/indexer/index/disk/unique_test.go @@ -1,7 +1,8 @@ -package index +package disk import ( "github.com/owncloud/ocis/accounts/pkg/indexer/errors" + "github.com/owncloud/ocis/accounts/pkg/indexer/index" . "github.com/owncloud/ocis/accounts/pkg/indexer/test" "github.com/stretchr/testify/assert" "os" @@ -114,7 +115,7 @@ func TestErrors(t *testing.T) { assert.True(t, errors.IsNotFoundErr(&errors.NotFoundErr{})) } -func getUniqueIdxSut(t *testing.T) (sut Index, dataPath string) { +func getUniqueIdxSut(t *testing.T) (sut index.Index, dataPath string) { dataPath = WriteIndexTestData(t, TestData, "Id") sut = NewUniqueIndex("User", "Email", path.Join(dataPath, "users"), path.Join(dataPath, "indexer.disk")) err := sut.Init() diff --git a/accounts/pkg/indexer/indexer.go b/accounts/pkg/indexer/indexer.go index 09661b397..76189a8db 100644 --- a/accounts/pkg/indexer/indexer.go +++ b/accounts/pkg/indexer/indexer.go @@ -3,7 +3,7 @@ package indexer import ( "github.com/owncloud/ocis/accounts/pkg/indexer/errors" - "github.com/owncloud/ocis/accounts/pkg/indexer/index" + "github.com/owncloud/ocis/accounts/pkg/indexer/index/disk" "github.com/rs/zerolog" "path" ) @@ -32,7 +32,7 @@ func (i Indexer) AddUniqueIndex(t interface{}, indexBy, pkName, entityDirName st fullDataPath := path.Join(i.config.DataDir, entityDirName) indexPath := path.Join(i.config.DataDir, i.config.IndexRootDirName) - idx := index.NewUniqueIndex(typeName, indexBy, fullDataPath, indexPath) + idx := disk.NewUniqueIndex(typeName, indexBy, fullDataPath, indexPath) i.indices.addIndex(typeName, pkName, idx) return idx.Init() @@ -43,7 +43,7 @@ func (i Indexer) AddNonUniqueIndex(t interface{}, indexBy, pkName, entityDirName fullDataPath := path.Join(i.config.DataDir, entityDirName) indexPath := path.Join(i.config.DataDir, i.config.IndexRootDirName) - idx := index.NewNonUniqueIndex(typeName, indexBy, fullDataPath, indexPath) + idx := disk.NewNonUniqueIndex(typeName, indexBy, fullDataPath, indexPath) i.indices.addIndex(typeName, pkName, idx) return idx.Init()