Documentation
¶
Index ¶
- type Application
- type Controller
- type IController
- type IMiddleware
- type IRouter
- type Middleware
- type Request
- type Response
- type Router
- func (r *Router) Add(method, name string, control interface{}, middleware ...string)
- func (r *Router) GET(name string, ctrl interface{}, middleware ...string)
- func (r *Router) Group(prefix, ctrl, middleware string, fn func())
- func (r *Router) Handler()
- func (r *Router) OPTIONS(name string, ctrl interface{}, middleware ...string)
- func (r *Router) POST(name string, ctrl interface{}, middleware ...string)
- type Server
- type Wrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
Application 全局应用对象
type Controller ¶
type Controller struct {
*Wrapper
// contains filtered or unexported fields
}
Controller 控制器对象
type IController ¶
type IController interface {
// contains filtered or unexported methods
}
IController 控制器接口
type IMiddleware ¶
type IMiddleware interface {
Next()
Handler()
// contains filtered or unexported methods
}
IMiddleware 中间件接口
type IRouter ¶
type IRouter interface {
GET(name string, ctrl interface{}, middleware ...string)
POST(name string, ctrl interface{}, middleware ...string)
Add(methods, name string, ctrl interface{}, middleware ...string)
Handler()
}
IRouter 路由接口
type Middleware ¶
type Middleware struct {
*Wrapper
// contains filtered or unexported fields
}
Middleware 中间件对象
type Request ¶
Request 请求对象
func (*Request) Input ¶
Input 获取指定的请求参数内容,以字符串类型返回
Input(key) 获取请求参数,未设置时返回空字符串
Input(key, defaultVal) 获取请求参数,不存在时返回defaultVal
type Response ¶
type Response struct {
http.ResponseWriter
// contains filtered or unexported fields
}
Response 响应对象
func (*Response) HttpStatus ¶
HttpStatus 输出特定响应码
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router 路由器对象
Click to show internal directories.
Click to hide internal directories.