Documentation
¶
Overview ¶
*
- rest返回值结构类型定义
Index ¶
- Constants
- Variables
- func NewEnv(filename string)
- func PrintGCSummary(w http.ResponseWriter, r *http.Request)
- func Run()
- func StartPprof()
- type App
- type Controller
- func (p *Controller) Delete()
- func (p *Controller) Display() error
- func (p *Controller) Finish()
- func (p *Controller) Get()
- func (p *Controller) HandlerFunc(fn string) bool
- func (p *Controller) Head()
- func (p *Controller) Init(context *context.Context, actionName string, app IController)
- func (p *Controller) Name() string
- func (p *Controller) Options()
- func (p *Controller) Patch()
- func (p *Controller) Post()
- func (p *Controller) Prepare()
- func (p *Controller) Put()
- type ControllerRegistor
- type IController
- type IRestCtx
- type RedisSvc
- type RestCtx
- type XLogger
Constants ¶
View Source
const ( LevelDebug = iota LevelInfo LevelWarn LevelError LevelNone )
View Source
const VERSION = "1.0.0"
Variables ¶
View Source
var (
Env map[string]string //全局配置
)
View Source
var (
HTTPMETHOD = map[string]string{
"GET": "GET",
"POST": "POST",
"PUT": "PUT",
"DELETE": "DELETE",
"PATCH": "PATCH",
"OPTIONS": "OPTIONS",
"HEAD": "HEAD",
"TRACE": "TRACE",
"CONNECT": "CONNECT",
}
)
View Source
var LoggerLevel = map[string]int{ "debug": LevelDebug, "info": LevelInfo, "warn": LevelWarn, "error": LevelError, "none": LevelNone, }
Functions ¶
func PrintGCSummary ¶
func PrintGCSummary(w http.ResponseWriter, r *http.Request)
print gc information to io.Writer
Types ¶
type App ¶
type App struct { Handlers *ControllerRegistor Server *http.Server }
var (
EyeApp *App
)
func RESTRouter ¶
func RESTRouter(rootpath string, c IController) *App
type Controller ¶
type Controller struct { AppController interface{} Req *context.Context Resp []map[interface{}]interface{} // contains filtered or unexported fields }
func (*Controller) Delete ¶
func (p *Controller) Delete()
func (*Controller) Display ¶
func (p *Controller) Display() error
func (*Controller) Finish ¶
func (p *Controller) Finish()
func (*Controller) Get ¶
func (p *Controller) Get()
func (*Controller) HandlerFunc ¶
func (p *Controller) HandlerFunc(fn string) bool
func (*Controller) Head ¶
func (p *Controller) Head()
func (*Controller) Init ¶
func (p *Controller) Init(context *context.Context, actionName string, app IController)
func (*Controller) Name ¶
func (p *Controller) Name() string
func (*Controller) Options ¶
func (p *Controller) Options()
func (*Controller) Patch ¶
func (p *Controller) Patch()
func (*Controller) Post ¶
func (p *Controller) Post()
func (*Controller) Prepare ¶
func (p *Controller) Prepare()
func (*Controller) Put ¶
func (p *Controller) Put()
type ControllerRegistor ¶
type ControllerRegistor struct {
Mux map[string]*routerItem
}
func NewControllerRegister ¶
func NewControllerRegister() *ControllerRegistor
func (*ControllerRegistor) Add ¶
func (p *ControllerRegistor) Add(rootpath string, c IController, mappingMethods ...string)
func (*ControllerRegistor) Path ¶
func (p *ControllerRegistor) Path(path string) string
func (*ControllerRegistor) ServeHTTP ¶
func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
type IController ¶
type RedisSvc ¶
type RedisSvc struct {
// contains filtered or unexported fields
}
func (*RedisSvc) ActiveCount ¶
type RestCtx ¶
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Usage: ctx := context.Context{Request:req,ResponseWriter:rw}
|
Usage: ctx := context.Context{Request:req,ResponseWriter:rw} |
demo
|
|
* * 数据存储定义 * @author dzh * @date 2015-08-05 * * 数据存储定义 * @author dzh * @date 2015-08-05
|
* * 数据存储定义 * @author dzh * @date 2015-08-05 * * 数据存储定义 * @author dzh * @date 2015-08-05 |
endless provides a drop in replacement for the `net/http` stl functions `ListenAndServe` and `ListenAndServeTLS` to achieve zero downtime restarts and code upgrades.
|
endless provides a drop in replacement for the `net/http` stl functions `ListenAndServe` and `ListenAndServeTLS` to achieve zero downtime restarts and code upgrades. |
Click to show internal directories.
Click to hide internal directories.