From 19f1fd11c4b6a00b480566cfd1bf67f2d0b0c0f7 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Tue, 13 Oct 2020 16:22:25 +0200 Subject: [PATCH] Align order of cuntions with index interface --- accounts/pkg/indexer/index/cs3/unique.go | 28 ++++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/accounts/pkg/indexer/index/cs3/unique.go b/accounts/pkg/indexer/index/cs3/unique.go index afb1f4d96..a93bba35b 100644 --- a/accounts/pkg/indexer/index/cs3/unique.go +++ b/accounts/pkg/indexer/index/cs3/unique.go @@ -121,20 +121,6 @@ func (idx *Unique) Init() error { return nil } -// Add adds a value to the index, returns the path to the root-document -func (idx *Unique) Add(id, v string) (string, error) { - newName := path.Join(idx.indexRootDir, v) - if err := idx.createSymlink(id, newName); err != nil { - if os.IsExist(err) { - return "", &idxerrs.AlreadyExistsErr{TypeName: idx.typeName, Key: idx.indexBy, Value: v} - } - - return "", err - } - - return newName, nil -} - // Lookup exact lookup by value. func (idx *Unique) Lookup(v string) ([]string, error) { searchPath := path.Join(idx.indexRootDir, v) @@ -150,6 +136,20 @@ func (idx *Unique) Lookup(v string) ([]string, error) { return []string{oldname}, nil } +// Add adds a value to the index, returns the path to the root-document +func (idx *Unique) Add(id, v string) (string, error) { + newName := path.Join(idx.indexRootDir, v) + if err := idx.createSymlink(id, newName); err != nil { + if os.IsExist(err) { + return "", &idxerrs.AlreadyExistsErr{TypeName: idx.typeName, Key: idx.indexBy, Value: v} + } + + return "", err + } + + return newName, nil +} + // Remove a value v from an index. func (idx *Unique) Remove(id string, v string) error { searchPath := path.Join(idx.indexRootDir, v)