概要
- type Controller struct {
- Name string // 控制器名称, 比如: "Application"
- Type *ControllerType // 控制器类型描述
- MethodType *MethodType // 控制器方法描述
- AppController interface{} // 控制器实例
-
- Request *Request
- Response *Response
- Result Result
-
- Flash Flash // 用户 cookie, 在请求之后清空
- Session Session // Session, 保存在cookie中,签名。
- Params *Params // URL和表单中的参数(包扩 multipart).
- RenderArgs map[string]interface{} // 传递给模板的参数
- Validation *Validation // 数据验证帮助器
- }
-
- // 统一的请求参数包装
- // 包括:
- // - URL 查询字符串
- // - Form 表单字段
- // - File 文件上传
- type Params struct {
- url.Values
- Files map[string][]*multipart.FileHeader
- }
- type Request struct {
- *http.Request
- ContentType string
- }
-
- type Response struct {
- Status int
- ContentType string
- Headers http.Header
- Cookies []*http.Cookie
-
- Out http.ResponseWriter
- }