@@ -8,8 +8,14 @@ import (
8
8
// Interfaces are differentiated based on required returned values.
9
9
// All input arguments are to be pulled from Request (the only arg).
10
10
11
+ // The Handler interfaces all take the Request object as its only argument.
12
+ // All the data you should need to handle the call are in the Request object.
13
+ // The request.Method attribute is initially the most important one as it
14
+ // determines which Handler gets called.
15
+
11
16
// FileReader should return an io.ReaderAt for the filepath
12
17
// Note in cases of an error, the error text will be sent to the client.
18
+ // Called for Methods: Get
13
19
type FileReader interface {
14
20
Fileread (* Request ) (io.ReaderAt , error )
15
21
}
@@ -19,18 +25,21 @@ type FileReader interface {
19
25
// The request server code will call Close() on the returned io.WriterAt
20
26
// ojbect if an io.Closer type assertion succeeds.
21
27
// Note in cases of an error, the error text will be sent to the client.
28
+ // Called for Methods: Put, Open
22
29
type FileWriter interface {
23
30
Filewrite (* Request ) (io.WriterAt , error )
24
31
}
25
32
26
33
// FileCmder should return an error
27
34
// Note in cases of an error, the error text will be sent to the client.
35
+ // Called for Methods: Setstat, Rename, Rmdir, Mkdir, Symlink, Remove
28
36
type FileCmder interface {
29
37
Filecmd (* Request ) error
30
38
}
31
39
32
40
// FileLister should return an object that fulfils the ListerAt interface
33
41
// Note in cases of an error, the error text will be sent to the client.
42
+ // Called for Methods: List, Stat, Readlink
34
43
type FileLister interface {
35
44
Filelist (* Request ) (ListerAt , error )
36
45
}
0 commit comments