a correct implementation of filer

This commit is contained in:
Chris Lu
2014-04-09 09:44:58 -07:00
parent 67be8a5af8
commit abde40377c
10 changed files with 536 additions and 148 deletions

19
go/filer/filer.go Normal file
View File

@@ -0,0 +1,19 @@
package filer
import ()
type FileId string //file id on weedfs
type FileEntry struct {
Name string //file name without path
Id FileId
}
type Filer interface {
CreateFile(filePath string, fid string) (err error)
FindFile(filePath string) (fid string, err error)
ListDirectories(dirPath string) (dirs []DirectoryEntry, err error)
ListFiles(dirPath string, lastFileName string, limit int) (files []FileEntry, err error)
DeleteDirectory(dirPath string) (err error)
DeleteFile(filePath string) (fid string, err error)
}