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.

19 lines
693 B

  1. package filer
  2. type FileId string //file id on weedfs
  3. type FileEntry struct {
  4. Name string `json:"name,omitempty"` //file name without path
  5. Id FileId `json:"fid,omitempty"`
  6. }
  7. type Filer interface {
  8. CreateFile(filePath string, fid string) (err error)
  9. FindFile(filePath string) (fid string, err error)
  10. FindDirectory(dirPath string) (dirId DirectoryId, err error)
  11. ListDirectories(dirPath string) (dirs []DirectoryEntry, err error)
  12. ListFiles(dirPath string, lastFileName string, limit int) (files []FileEntry, err error)
  13. DeleteDirectory(dirPath string, recursive bool) (err error)
  14. DeleteFile(filePath string) (fid string, err error)
  15. Move(fromPath string, toPath string) (err error)
  16. }