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

18
go/filer/directory.go Normal file
View File

@@ -0,0 +1,18 @@
package filer
import ()
type DirectoryId int32
type DirectoryEntry struct {
Name string //dir name without path
Id DirectoryId
}
type DirectoryManager interface {
FindDirectory(dirPath string) (DirectoryId, error)
ListDirectories(dirPath string) (dirNames []DirectoryEntry, err error)
MakeDirectory(currentDirPath string, dirName string) (DirectoryId, error)
MoveUnderDirectory(oldDirPath string, newParentDirPath string) error
DeleteDirectory(dirPath string) error
}