-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.go
69 lines (52 loc) · 1.07 KB
/
global.go
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package serv
import (
"time"
)
var (
server *Server
)
func init() {
server = New()
}
func Start(addr string) error {
return server.Start(addr)
}
func Shutdown() {
server.Shutdown()
}
func SetLongQueryHandler(delta time.Duration, fn LongQueryHandler) {
server.SetLongQueryHandler(delta, fn)
}
func SetErrorHandler(fn ErrorHandler) {
server.SetErrorHandler(fn)
}
func SetAuthCheck(fn AuthCheck) {
server.SetAuthCheck(fn)
}
func SetUID(enable bool) {
server.SetUID(enable)
}
func SetLogger(l Logger) {
server.SetLogger(l)
}
func Static(prefix string, dir string) {
server.Static(prefix, dir)
}
func File(path string, filename string) {
server.File(path, filename)
}
func Register(method string, path string, fn Handler) {
server.Register(method, path, fn)
}
func RegisterAuth(method string, path string, fn Handler) {
server.RegisterAuth(method, path, fn)
}
func RegMethod(method string, fn interface{}) {
server.RegMethod(method, fn)
}
func RegisterJsonRPC(url string) {
server.RegisterJsonRPC(url)
}
func LoadTemplates(dir string) {
server.LoadTemplates(dir)
}