2015-01-06 07:03:27 +00:00
|
|
|
package flat_namespace
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
|
|
|
|
"github.com/chrislusf/weed-fs/go/filer"
|
|
|
|
)
|
|
|
|
|
|
|
|
type FlatNamesapceFiler struct {
|
|
|
|
master string
|
|
|
|
store FlatNamespaceStore
|
|
|
|
}
|
|
|
|
|
|
|
|
var (
|
2015-03-10 07:20:31 +00:00
|
|
|
ErrNotImplemented = errors.New("Not Implemented for flat namespace meta data store")
|
2015-01-06 07:03:27 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func NewFlatNamesapceFiler(master string, store FlatNamespaceStore) *FlatNamesapceFiler {
|
|
|
|
return &FlatNamesapceFiler{
|
|
|
|
master: master,
|
|
|
|
store: store,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (filer *FlatNamesapceFiler) CreateFile(fullFileName string, fid string) (err error) {
|
|
|
|
return filer.store.Put(fullFileName, fid)
|
|
|
|
}
|
|
|
|
func (filer *FlatNamesapceFiler) FindFile(fullFileName string) (fid string, err error) {
|
|
|
|
return filer.store.Get(fullFileName)
|
|
|
|
}
|
|
|
|
func (filer *FlatNamesapceFiler) FindDirectory(dirPath string) (dirId filer.DirectoryId, err error) {
|
2015-03-10 07:20:31 +00:00
|
|
|
return 0, ErrNotImplemented
|
2015-01-06 07:03:27 +00:00
|
|
|
}
|
|
|
|
func (filer *FlatNamesapceFiler) ListDirectories(dirPath string) (dirs []filer.DirectoryEntry, err error) {
|
2015-03-10 07:20:31 +00:00
|
|
|
return nil, ErrNotImplemented
|
2015-01-06 07:03:27 +00:00
|
|
|
}
|
|
|
|
func (filer *FlatNamesapceFiler) ListFiles(dirPath string, lastFileName string, limit int) (files []filer.FileEntry, err error) {
|
2015-03-10 07:20:31 +00:00
|
|
|
return nil, ErrNotImplemented
|
2015-01-06 07:03:27 +00:00
|
|
|
}
|
|
|
|
func (filer *FlatNamesapceFiler) DeleteDirectory(dirPath string, recursive bool) (err error) {
|
2015-03-10 07:20:31 +00:00
|
|
|
return ErrNotImplemented
|
2015-01-06 07:03:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (filer *FlatNamesapceFiler) DeleteFile(fullFileName string) (fid string, err error) {
|
|
|
|
return filer.store.Delete(fullFileName)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (filer *FlatNamesapceFiler) Move(fromPath string, toPath string) error {
|
2015-03-10 07:20:31 +00:00
|
|
|
return ErrNotImplemented
|
2015-01-06 07:03:27 +00:00
|
|
|
}
|