2018-05-26 14:27:06 +08:00
|
|
|
package filer2
|
|
|
|
|
2018-05-26 18:49:46 +08:00
|
|
|
import (
|
2019-03-16 06:55:34 +08:00
|
|
|
"context"
|
2018-05-26 18:49:46 +08:00
|
|
|
"errors"
|
2018-08-20 06:17:55 +08:00
|
|
|
"github.com/chrislusf/seaweedfs/weed/util"
|
2018-05-26 18:49:46 +08:00
|
|
|
)
|
2018-05-26 14:27:06 +08:00
|
|
|
|
|
|
|
type FilerStore interface {
|
2018-06-18 04:24:57 +08:00
|
|
|
// GetName gets the name to locate the configuration in filer.toml file
|
2018-05-26 18:49:46 +08:00
|
|
|
GetName() string
|
2018-06-18 04:01:57 +08:00
|
|
|
// Initialize initializes the file store
|
2018-08-20 06:17:55 +08:00
|
|
|
Initialize(configuration util.Configuration) error
|
2019-03-16 06:55:34 +08:00
|
|
|
InsertEntry(context.Context, *Entry) error
|
|
|
|
UpdateEntry(context.Context, *Entry) (err error)
|
2018-07-20 17:14:18 +08:00
|
|
|
// err == filer2.ErrNotFound if not found
|
2019-03-16 06:55:34 +08:00
|
|
|
FindEntry(context.Context, FullPath) (entry *Entry, err error)
|
|
|
|
DeleteEntry(context.Context, FullPath) (err error)
|
|
|
|
ListDirectoryEntries(ctx context.Context, dirPath FullPath, startFileName string, includeStartFile bool, limit int) ([]*Entry, error)
|
2018-05-26 14:27:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
var ErrNotFound = errors.New("filer: no entry is found in filer store")
|