diff --git a/go/filer/flat_namespace/flat_namespace_filer.go b/go/filer/flat_namespace/flat_namespace_filer.go index 9959b2924..2a2fd657b 100644 --- a/go/filer/flat_namespace/flat_namespace_filer.go +++ b/go/filer/flat_namespace/flat_namespace_filer.go @@ -29,16 +29,16 @@ func (filer *FlatNamespaceFiler) FindFile(fullFileName string) (fid string, err return filer.store.Get(fullFileName) } func (filer *FlatNamespaceFiler) FindDirectory(dirPath string) (dirId filer.DirectoryId, err error) { - return 0, ErrNotImplemented + return filer.store.FindDirectory(dirPath) } func (filer *FlatNamespaceFiler) ListDirectories(dirPath string) (dirs []filer.DirectoryEntry, err error) { - return nil, ErrNotImplemented + return filer.store.ListDirectories(dirPath) } func (filer *FlatNamespaceFiler) ListFiles(dirPath string, lastFileName string, limit int) (files []filer.FileEntry, err error) { - return nil, ErrNotImplemented + return filer.store.ListFiles(dirPath, lastFileName, limit) } func (filer *FlatNamespaceFiler) DeleteDirectory(dirPath string, recursive bool) (err error) { - return ErrNotImplemented + return filer.store.DeleteDirectory(dirPath, recursive) } func (filer *FlatNamespaceFiler) DeleteFile(fullFileName string) (fid string, err error) { @@ -46,5 +46,5 @@ func (filer *FlatNamespaceFiler) DeleteFile(fullFileName string) (fid string, er } func (filer *FlatNamespaceFiler) Move(fromPath string, toPath string) error { - return ErrNotImplemented + return filer.store.Move(fromPath, toPath) } diff --git a/go/filer/flat_namespace/flat_namespace_store.go b/go/filer/flat_namespace/flat_namespace_store.go index 832b70e40..8bb0d0a13 100644 --- a/go/filer/flat_namespace/flat_namespace_store.go +++ b/go/filer/flat_namespace/flat_namespace_store.go @@ -1,9 +1,16 @@ package flat_namespace -import () +import "github.com/chrislusf/seaweedfs/go/filer" type FlatNamespaceStore interface { Put(fullFileName string, fid string) (err error) Get(fullFileName string) (fid string, err error) Delete(fullFileName string) (fid string, err error) + + //redis store support these functions + FindDirectory(dirPath string) (dirId filer.DirectoryId, err error) + ListDirectories(dirPath string) (dirs []filer.DirectoryEntry, err error) + ListFiles(dirPath string, lastFileName string, limit int) (files []filer.FileEntry, err error) + DeleteDirectory(dirPath string, recursive bool) (err error) + Move(fromPath string, toPath string) error }