Documentation ¶
Overview ¶
在用户和实际逻辑之间做一个中转 封装相关方法帮用户更好的使用
Index ¶
- Constants
- func AddBFilter(fs ...middleware.BeforeFilter)
- func AddLFilter(fs ...middleware.LaterFilter)
- func AddMiddlerware(fs ...middleware.Middleware)
- func AddStaticPrefix(prefixs ...string)
- func Listen(port int) error
- func Start(port int)
- type Context
- func (this *Context) AddHeader(name, value string)
- func (this *Context) BodyJson() string
- func (this *Context) Forward(forwardUrl string)
- func (this *Context) Ip() string
- func (this *Context) Param(name string) string
- func (this *Context) ParamInt(name string) int
- func (this *Context) PathParam(name string) string
- func (this *Context) PostParam(name string) string
- func (this *Context) Redirect(redirectUrl string, code int)
- func (this *Context) Seesion() session.Session
- func (this *Context) SetHttpStatus(num int)
- func (this *Context) URI() string
- func (this *Context) WriteBytes(bytes []byte)
- func (this *Context) WriteJson(jsonStruct interface{})
- type Doob
- type HttpMethod
- type Router
- func (r Router) AddHandlerFunc(allUrl string, handler interface{}, methods ...HttpMethod)
- func (r Router) Delete(allUrl string, handler interface{})
- func (r Router) Get(allUrl string, handler interface{})
- func (r Router) Head(allUrl string, handler interface{})
- func (r Router) Options(allUrl string, handler interface{})
- func (r Router) Post(allUrl string, handler interface{})
- func (r Router) Put(allUrl string, handler interface{})
Constants ¶
View Source
const ( DOOB = "doob" VERSION = " 0.1.4 dev" )
Variables ¶
This section is empty.
Functions ¶
func AddBFilter ¶ added in v0.2.0
func AddBFilter(fs ...middleware.BeforeFilter)
func AddLFilter ¶ added in v0.2.0
func AddLFilter(fs ...middleware.LaterFilter)
func AddMiddlerware ¶ added in v0.2.0
func AddMiddlerware(fs ...middleware.Middleware)
func AddStaticPrefix ¶
func AddStaticPrefix(prefixs ...string)
Types ¶
type Context ¶
type Context struct { Request *http.Request Response http.ResponseWriter PathParams map[string]string }
对 ResponseWriter 和 request 封装的上下文
type HttpMethod ¶
type HttpMethod string
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
封装node,对外提供简单方法
func DefaultRouter ¶
func DefaultRouter() Router
func (Router) AddHandlerFunc ¶
func (r Router) AddHandlerFunc(allUrl string, handler interface{}, methods ...HttpMethod)
Directories ¶
Path | Synopsis |
---|---|
http
|
|
const
http related const store
|
http related const store |
return_deal
处理用户注册的 handle func 的返回值 列如
|
处理用户注册的 handle func 的返回值 列如 |
在用户注册 handle func 的时候对函数进行分析 并分已不同的类别,在执行时根据类别进行不同的处理
|
在用户注册 handle func 的时候对函数进行分析 并分已不同的类别,在执行时根据类别进行不同的处理 |
Click to show internal directories.
Click to hide internal directories.