seaweedfs/weed/filer2/filerstore.go

27 lines
928 B
Go
Raw Normal View History

2018-05-26 06:27:06 +00:00
package filer2
import (
2019-03-15 22:55:34 +00:00
"context"
"errors"
"github.com/chrislusf/seaweedfs/weed/util"
)
2018-05-26 06:27:06 +00:00
type FilerStore interface {
// GetName gets the name to locate the configuration in filer.toml file
GetName() string
2018-06-17 20:01:57 +00:00
// Initialize initializes the file store
Initialize(configuration util.Configuration) error
2019-03-15 22:55:34 +00:00
InsertEntry(context.Context, *Entry) error
UpdateEntry(context.Context, *Entry) (err error)
// 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)
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")