概要

    1. type Controller struct {
    2. Name string // 控制器名称, 比如: "Application"
    3. Type *ControllerType // 控制器类型描述
    4. MethodType *MethodType // 控制器方法描述
    5. AppController interface{} // 控制器实例
    6.  
    7. Request *Request
    8. Response *Response
    9. Result Result
    10.  
    11. Flash Flash // 用户 cookie, 在请求之后清空
    12. Session Session // Session, 保存在cookie中,签名。
    13. Params *Params // URL和表单中的参数(包扩 multipart).
    14. RenderArgs map[string]interface{} // 传递给模板的参数
    15. Validation *Validation // 数据验证帮助器
    16. }
    17.  
    18. // 统一的请求参数包装
    19. // 包括:
    20. // - URL 查询字符串
    21. // - Form 表单字段
    22. // - File 文件上传
    23. type Params struct {
    24. url.Values
    25. Files map[string][]*multipart.FileHeader
    26. }
    27. type Request struct {
    28. *http.Request
    29. ContentType string
    30. }
    31.  
    32. type Response struct {
    33. Status int
    34. ContentType string
    35. Headers http.Header
    36. Cookies []*http.Cookie
    37.  
    38. Out http.ResponseWriter
    39. }