-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinterface.go
74 lines (54 loc) · 2.03 KB
/
interface.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
70
71
72
73
74
package godd
//==================================
// InterfaceClose for Manage Defer Close
type InterfaceClose interface {
Close() error
}
//==================================
// InterfaceApp interface
type InterfaceApp interface {
GetFramework() FrameWork
App() interface{}
SetApp(interface{})
Listen(port string, extraList ...interface{}) error
Shutdown() error
Get(path string, context *Context, handleList ...Handler) InterfaceHTTP
Group(path string, context *Context, handleList ...Handler) InterfaceHTTP
IsSupportHTTP() bool
}
//==================================
// InterfaceHTTP interface
type InterfaceHTTP interface {
Add(method string, path string, context *Context, handleList ...func(context *Context) error)
Get(path string, context *Context, handleList ...func(context *Context) error)
Post(path string, context *Context, handleList ...func(context *Context) error)
Put(path string, context *Context, handleList ...func(context *Context) error)
Patch(path string, context *Context, handleList ...func(context *Context) error)
Delete(path string, context *Context, handleList ...func(context *Context) error)
}
//==================================
// InterfaceAMQP interface
type InterfaceAMQP interface {
}
//==================================
// InterfaceContext interface
type InterfaceContext interface {
GetFramework() FrameWork
GetFrameworkContext() interface{}
Response(responseDataList interface{}, contentType string, responseCode ...int) error
Redirect(location string, responseCode ...int) error
SetContentType(str string)
SetHeader(key string, val string)
GetHeader(key string, defaultValue ...string) string
GetQuery(key string, defaultValue ...string) string
QueryParser(out interface{}) error
GetParam(key string, defaultValue ...string) string
GetBody() []byte
BodyParser(out interface{}) error
GetCookie(key string, val string)
SetCookie(cookie interface{})
ClearCookie(key ...string)
Log(v ...interface{})
}
// Get(path string, handleList ...Handler) Router
//==================================