2018-05-11 09:20:15 +00:00
|
|
|
package embedded
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/syndtr/goleveldb/leveldb"
|
2018-05-12 20:45:29 +00:00
|
|
|
"github.com/chrislusf/seaweedfs/weed/filer2"
|
2018-05-11 09:20:15 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type EmbeddedStore struct {
|
|
|
|
db *leveldb.DB
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewEmbeddedStore(dir string) (filer *EmbeddedStore, err error) {
|
|
|
|
filer = &EmbeddedStore{}
|
|
|
|
if filer.db, err = leveldb.OpenFile(dir, nil); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2018-05-12 20:45:29 +00:00
|
|
|
func (filer *EmbeddedStore) InsertEntry(entry *filer2.Entry) (err error) {
|
2018-05-11 09:20:15 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2018-05-12 20:45:29 +00:00
|
|
|
func (filer *EmbeddedStore) AddDirectoryLink(directory *filer2.Entry, delta int32) (err error) {
|
2018-05-11 09:20:15 +00:00
|
|
|
return nil
|
|
|
|
}
|
2018-05-12 20:45:29 +00:00
|
|
|
|
2018-05-22 10:26:38 +00:00
|
|
|
func (filer *EmbeddedStore) UpdateEntry(entry *filer2.Entry) (err error) {
|
2018-05-12 20:45:29 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (filer *EmbeddedStore) FindEntry(fullpath filer2.FullPath) (found bool, entry *filer2.Entry, err error) {
|
|
|
|
return false, nil, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (filer *EmbeddedStore) DeleteEntry(fullpath filer2.FullPath) (entry *filer2.Entry, err error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
2018-05-13 21:02:29 +00:00
|
|
|
func (filer *EmbeddedStore) ListDirectoryEntries(fullpath filer2.FullPath, startFileName string, inclusive bool, limit int) (entries []*filer2.Entry, err error) {
|
2018-05-12 20:45:29 +00:00
|
|
|
return nil, nil
|
|
|
|
}
|