Documentation ¶
Index ¶
- type AppConfig
- type Context
- func (c *Context) Body() (string, error)
- func (c *Context) BodyJson(obj interface{}) error
- func (c *Context) Error(code int, err error)
- func (c *Context) Fail(code int, msg string)
- func (c *Context) Form() url.Values
- func (c *Context) GetHeader(key string) string
- func (c *Context) JSON(code int, obj interface{})
- func (c *Context) Make(code int, rcode int, data interface{}, msg string)
- func (c *Context) PathParam(index int) string
- func (c *Context) PathParamInt(index int) (int, error)
- func (c *Context) PathParamInt64(index int) (int64, error)
- func (c *Context) QueryAll() url.Values
- func (c *Context) QueryInt(key string) (int, error)
- func (c *Context) QueryInt64(key string) (int64, error)
- func (c *Context) QueryIntDefault(key string, def int) (int, error)
- func (c *Context) QueryMap() (m map[string]interface{})
- func (c *Context) QueryStr(key string) string
- func (c *Context) QueryStruct(dst interface{})
- func (c *Context) String(code int, format string, values ...interface{})
- func (c *Context) Success(code int, data interface{})
- type Engine
- func (engine *Engine) DELETE(pattern string, handler func(*Context))
- func (engine *Engine) GET(pattern string, handler func(*Context))
- func (engine *Engine) GetHandle(mapHandle map[int]http.HandlerFunc) http.HandlerFunc
- func (engine *Engine) HEAD(pattern string, handler func(*Context))
- func (engine *Engine) HandleFunc(method, pattern string, handler func(*Context))
- func (engine *Engine) OPTIONS(pattern string, handler func(*Context))
- func (engine *Engine) PATCH(pattern string, handler func(*Context))
- func (engine *Engine) POST(pattern string, handler func(*Context))
- func (engine *Engine) PUT(pattern string, handler func(*Context))
- func (engine *Engine) PathMatch(path, pattern string) int
- func (engine *Engine) Run(address string) (err error)
- func (engine *Engine) ServeHTTP(w http.ResponseWriter, r *http.Request)
- type Route
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppConfig ¶ added in v0.0.8
type AppConfig struct { Profile string //dev,test,prod App xjtypes.App //服务的名称等 Register xjtypes.Register //如果服务都注册到ETCD,这个可以不要 Gateway xjtypes.Gateway //如果服务间的调用都通过rpc,这个可以不要 Config xjtypes.Config //如果配置使用本地配置文件, 这个可以不要 Etcd xjtypes.Etcd //http和rpc服务的注册管理 Auth xjtypes.Auth //jwt验证的密钥和有效时间 Datasource xjtypes.Datasource //数据源 Redis xjtypes.Redis //缓存 ElasticSearch xjtypes.ElasticSearch //es搜索 Nsq xjtypes.Nsq //NSQ消息 }
type Context ¶ added in v0.0.8
type Context struct { Request *http.Request Writer http.ResponseWriter }
func (*Context) PathParamInt ¶ added in v0.1.7
func (*Context) PathParamInt64 ¶ added in v0.1.7
func (*Context) QueryInt64 ¶ added in v0.1.0
func (*Context) QueryIntDefault ¶ added in v0.1.5
func (*Context) QueryStruct ¶ added in v0.1.5
func (c *Context) QueryStruct(dst interface{})
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) GetHandle ¶
func (engine *Engine) GetHandle(mapHandle map[int]http.HandlerFunc) http.HandlerFunc
func (*Engine) HandleFunc ¶
Click to show internal directories.
Click to hide internal directories.