diff options
| author | Chris Lu <chris.lu@gmail.com> | 2014-05-13 11:25:48 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2014-05-13 11:25:48 -0700 |
| commit | dc24bad791743c6e1c96602b3678dde4954f795a (patch) | |
| tree | e6f42dfd524ee7194fec1d9aeea7c4c375e479c9 /go/filer/operations.go | |
| parent | 750e1aaaa5cf2a224f18e28f2974b48a1b31efd0 (diff) | |
| download | seaweedfs-dc24bad791743c6e1c96602b3678dde4954f795a.tar.xz seaweedfs-dc24bad791743c6e1c96602b3678dde4954f795a.zip | |
releasing 0.58 to handle control+c interrupts.
compilable now. but FUSE mount is not working.
Diffstat (limited to 'go/filer/operations.go')
| -rw-r--r-- | go/filer/operations.go | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/go/filer/operations.go b/go/filer/operations.go deleted file mode 100644 index 7e89b534d..000000000 --- a/go/filer/operations.go +++ /dev/null @@ -1,58 +0,0 @@ -package filer - -import () - -import ( - "code.google.com/p/weed-fs/go/util" - "encoding/json" - "errors" - _ "fmt" - "net/url" - "strconv" -) - -type ListFilesResult struct { - Files []FileEntry - Error string `json:"error,omitempty"` -} - -func ListFiles(server string, directoryId DirectoryId, fileName string) (*ListFilesResult, error) { - values := make(url.Values) - values.Add("directoryId", strconv.Itoa(int(directoryId))) - jsonBlob, err := util.Post("http://"+server+"/dir/lookup", values) - if err != nil { - return nil, err - } - var ret ListFilesResult - err = json.Unmarshal(jsonBlob, &ret) - if err != nil { - return nil, err - } - if ret.Error != "" { - return nil, errors.New(ret.Error) - } - return &ret, nil -} - -type ListDirectoriesResult struct { - Directories []DirectoryEntry - Error string `json:"error,omitempty"` -} - -func ListDirectories(server string, directoryId DirectoryId) (*ListDirectoriesResult, error) { - values := make(url.Values) - values.Add("directoryId", strconv.Itoa(int(directoryId))) - jsonBlob, err := util.Post("http://"+server+"/dir/lookup", values) - if err != nil { - return nil, err - } - var ret ListDirectoriesResult - err = json.Unmarshal(jsonBlob, &ret) - if err != nil { - return nil, err - } - if ret.Error != "" { - return nil, errors.New(ret.Error) - } - return &ret, nil -} |
