You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
928 B

7 years ago
7 years ago
7 years ago
  1. package filer2
  2. import (
  3. "context"
  4. "errors"
  5. "github.com/chrislusf/seaweedfs/weed/util"
  6. )
  7. type FilerStore interface {
  8. // GetName gets the name to locate the configuration in filer.toml file
  9. GetName() string
  10. // Initialize initializes the file store
  11. Initialize(configuration util.Configuration) error
  12. InsertEntry(context.Context, *Entry) error
  13. UpdateEntry(context.Context, *Entry) (err error)
  14. // err == filer2.ErrNotFound if not found
  15. FindEntry(context.Context, FullPath) (entry *Entry, err error)
  16. DeleteEntry(context.Context, FullPath) (err error)
  17. ListDirectoryEntries(ctx context.Context, dirPath FullPath, startFileName string, includeStartFile bool, limit int) ([]*Entry, error)
  18. BeginTransaction(ctx context.Context) (context.Context, error)
  19. CommitTransaction(ctx context.Context) error
  20. RollbackTransaction(ctx context.Context) error
  21. }
  22. var ErrNotFound = errors.New("filer: no entry is found in filer store")