Documentation
¶
Index ¶
- Constants
- type APIInfo
- type Context
- type Handle
- type HttpTest
- type PrometheusList
- type RespMsg
- type ResponseWriter
- func (lrw *ResponseWriter) AbortWithStatus(code int)
- func (lrw *ResponseWriter) Size() int
- func (lrw *ResponseWriter) Status() int
- func (lrw *ResponseWriter) Write(data []byte) (n int, err error)
- func (lrw *ResponseWriter) WriteHeader(code int)
- func (lrw *ResponseWriter) WriteString(s string) (n int, err error)
- func (lrw *ResponseWriter) Written() bool
- type Router
- func (router *Router) AddRoute(method, path string, perm uint, conf interface{}, handlers ...Handle)
- func (router *Router) NotFound()
- func (router *Router) PutRouterList(rl *RouterList, conf interface{})
- func (router *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (router *Router) SetupPrometheus()
- type RouterList
Constants ¶
View Source
const ( /* 1: 登陆认证失败 2:用户请求数据处理失败 3:服务端处理失败 */ StatusOK = 0 StatusInvalidSign = 1000 StatusLoginFailed = 1003 StatusAccessDenied = 1199 // 请求参数合法性验证 StatusNotLegalInput = 1201 // json请求校验失败 StatusBodyInvalid = 1204 StatusDataProcessingFailed = 3000 StatusSaveDataFailed = 3001 StatusNotFound = 3010 )
View Source
const ( TypeJson = "application/json; charset=UTF-8" TypePlain = "text/plain; charset=UTF-8" TypeHtml = "text/html; charset=UTF-8" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
Req *http.Request
Writer *ResponseWriter
Params httprouter.Params
Keys map[string]interface{}
Response interface{}
Begin time.Time
NoLog bool
OpLog *bytes.Buffer
Body *bytes.Buffer
BodyLen int64
BodyMap map[string]interface{}
ContextType string
Perm uint
}
Context http会话期间的session