-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmod.go
More file actions
53 lines (35 loc) · 1018 Bytes
/
mod.go
File metadata and controls
53 lines (35 loc) · 1018 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package mod
import (
"net/http"
)
/**
Interface for mod
*/
type Interface interface {
// 占位签名, 表示采用 mod 的接口风格.
GitHubTypepressMod()
}
type Finish func(http.ResponseWriter, *http.Request) bool
func (h Finish) GitHubTypepressMod() {}
func (h Finish) ServeHTTP(
rw http.ResponseWriter, req *http.Request) bool {
return h(rw, req)
}
type Dir func(http.Dir, http.ResponseWriter, *http.Request) bool
func (h Dir) GitHubTypepressMod() {}
func (h Dir) ServeHTTP(dir http.Dir,
rw http.ResponseWriter, req *http.Request) bool {
return h(dir, rw, req)
}
type String func(string, http.ResponseWriter, *http.Request) bool
func (h String) GitHubTypepressMod() {}
func (h String) ServeHTTP(v string,
rw http.ResponseWriter, req *http.Request) bool {
return h(v, rw, req)
}
type Uint func(uint, http.ResponseWriter, *http.Request) bool
func (h Uint) GitHubTypepressMod() {}
func (h Uint) ServeHTTP(v uint,
rw http.ResponseWriter, req *http.Request) bool {
return h(v, rw, req)
}