From 9a30688521dcebc8a99d56e07040dabb53ce7337 Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Fri, 23 Oct 2020 16:53:13 +0200 Subject: [PATCH] implement Delete operation --- accounts/pkg/indexer/index/disk/autoincrement.go | 2 +- accounts/pkg/indexer/index/disk/helper.go | 1 + accounts/pkg/indexer/index/disk/non_unique.go | 2 +- accounts/pkg/indexer/index/disk/unique.go | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 accounts/pkg/indexer/index/disk/helper.go diff --git a/accounts/pkg/indexer/index/disk/autoincrement.go b/accounts/pkg/indexer/index/disk/autoincrement.go index 279b5edb8c..d686652304 100644 --- a/accounts/pkg/indexer/index/disk/autoincrement.go +++ b/accounts/pkg/indexer/index/disk/autoincrement.go @@ -263,5 +263,5 @@ func (idx *Autoincrement) next() (int, error) { // Delete deletes the index folder from its storage. func (idx *Autoincrement) Delete() error { - return nil + return os.Remove(idx.indexRootDir) } diff --git a/accounts/pkg/indexer/index/disk/helper.go b/accounts/pkg/indexer/index/disk/helper.go new file mode 100644 index 0000000000..8be362d5f4 --- /dev/null +++ b/accounts/pkg/indexer/index/disk/helper.go @@ -0,0 +1 @@ +package disk diff --git a/accounts/pkg/indexer/index/disk/non_unique.go b/accounts/pkg/indexer/index/disk/non_unique.go index b4df3db5b8..3dfa6bc180 100644 --- a/accounts/pkg/indexer/index/disk/non_unique.go +++ b/accounts/pkg/indexer/index/disk/non_unique.go @@ -236,5 +236,5 @@ func (idx *NonUnique) FilesDir() string { // Delete deletes the index folder from its storage. func (idx *NonUnique) Delete() error { - return nil + return os.Remove(idx.indexRootDir) } diff --git a/accounts/pkg/indexer/index/disk/unique.go b/accounts/pkg/indexer/index/disk/unique.go index 6a53744695..751fd73ded 100644 --- a/accounts/pkg/indexer/index/disk/unique.go +++ b/accounts/pkg/indexer/index/disk/unique.go @@ -223,5 +223,5 @@ func isValidSymlink(path string) (err error) { // Delete deletes the index folder from its storage. func (idx *Unique) Delete() error { - return nil + return os.Remove(idx.indexRootDir) }