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.

28 lines
869 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 DirectoryId int32
  8. type DirectoryEntry struct {
  9. Name string //dir name without path
  10. Id DirectoryId
  11. }
  12. type Filer interface {
  13. CreateFile(fullFileName string, fid string) (err error)
  14. FindFile(fullFileName string) (fid string, err error)
  15. DeleteFile(fullFileName string) (fid string, err error)
  16. //Optional functions. embedded filer support these
  17. FindDirectory(dirPath string) (dirId DirectoryId, err error)
  18. ListDirectories(dirPath string) (dirs []DirectoryEntry, err error)
  19. ListFiles(dirPath string, lastFileName string, limit int) (files []FileEntry, err error)
  20. DeleteDirectory(dirPath string, recursive bool) (err error)
  21. Move(fromPath string, toPath string) (err error)
  22. }