-
Notifications
You must be signed in to change notification settings - Fork 0
/
context.go
32 lines (23 loc) · 936 Bytes
/
context.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
package mano
// Context Encapsulates all HTTP-specific information about an individual HTTP request.
type Context interface {
App() *Application
//Response 返回响应写入器
Response() *Response
Request() *Request
// Attr Gets or sets the HttpApplication object for the current HTTP request.
Attr(name string, value ...interface{}) interface{}
// Data Gets or sets the Context object for the current HTTP request.
Data(name string, value ...interface{}) interface{}
ViewData() map[string]interface{}
//PathValue returns a route path data with given name
PathValue(name string) (value string, ok bool)
Param(name string) string
Content(content string, contentType ...string) View
JSON(data interface{}, contentType ...string) View
Empty() View
View(template string, contentType ...string) View
}
// func (ctx *context) Log(format string, value ...interface{}) {
// return ctx.engine.Logger().Debug("")
// }