2018-05-26 06:27:06 +00:00
|
|
|
package filer2
|
|
|
|
|
2018-05-26 10:49:46 +00:00
|
|
|
import (
|
2019-03-15 22:55:34 +00:00
|
|
|
"context"
|
2018-05-26 10:49:46 +00:00
|
|
|
"errors"
|
2018-08-19 22:17:55 +00:00
|
|
|
"github.com/chrislusf/seaweedfs/weed/util"
|
2018-05-26 10:49:46 +00:00
|
|
|
)
|
2018-05-26 06:27:06 +00:00
|
|
|
|
|
|
|
type FilerStore interface {
|
2018-06-17 20:24:57 +00:00
|
|
|
// GetName gets the name to locate the configuration in filer.toml file
|
2018-05-26 10:49:46 +00:00
|
|
|
GetName() string
|
2018-06-17 20:01:57 +00:00
|
|
|
// Initialize initializes the file store
|
2018-08-19 22:17:55 +00:00
|
|
|
Initialize(configuration util.Configuration) error
|
2019-03-15 22:55:34 +00:00
|
|
|
InsertEntry(context.Context, *Entry) error
|
|
|
|
UpdateEntry(context.Context, *Entry) (err error)
|
2018-07-20 09:14:18 +00:00
|
|
|
// err == filer2.ErrNotFound if not found
|
2019-03-15 22:55:34 +00: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)
|
2019-03-31 06:08:29 +00:00
|
|
|
|
|
|
|
BeginTransaction(ctx context.Context) (context.Context, error)
|
|
|
|
CommitTransaction(ctx context.Context) error
|
|
|
|
RollbackTransaction(ctx context.Context) error
|
2018-05-26 06:27:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var ErrNotFound = errors.New("filer: no entry is found in filer store")
|