Documentation ¶
Index ¶
- func NewServer(cnf ServerConf) *server
- type Action
- type BaseController
- type Context
- func (ctx *Context) ActionName() string
- func (ctx *Context) ControllerName() string
- func (ctx *Context) FFloat64(key string, def float64) float64
- func (ctx *Context) FInt(key string, def int) int
- func (ctx *Context) FString(key string, def string) string
- func (ctx *Context) GFloat64(key string, def float64) float64
- func (ctx *Context) GInt(key string, def int) int
- func (ctx *Context) GString(key string, def string) string
- func (ctx *Context) Json(data interface{})
- func (ctx *Context) Proxy(target *url.URL)
- func (ctx *Context) Req() *http.Request
- func (ctx *Context) Res() http.ResponseWriter
- func (ctx *Context) Set(key interface{}, val interface{})
- func (ctx *Context) Value(key interface{}) (val interface{})
- type Controller
- type ServerConf
- type ServerMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewServer ¶
func NewServer(cnf ServerConf) *server
Types ¶
type BaseController ¶
type BaseController struct { }
BaseController 控制器基础实现
func (*BaseController) After ¶
func (b *BaseController) After(ctx *Context) error
func (*BaseController) Before ¶
func (b *BaseController) Before(ctx *Context) error
func (*BaseController) Ignore ¶
func (b *BaseController) Ignore() (lst []string)
func (*BaseController) Prefix ¶
func (b *BaseController) Prefix() string
func (*BaseController) Recover ¶
func (b *BaseController) Recover(ctx *Context, err interface{})
type Context ¶
func (*Context) ActionName ¶
func (*Context) ControllerName ¶
type Controller ¶
type ServerConf ¶
type ServerConf struct { Boot string Mode ServerMode IgnorePathCase bool ControllerPath string }
type ServerMode ¶
type ServerMode string
ServerMode 服务启动模式
const ( DEBUG ServerMode = "debug" RELEASE ServerMode = "release" )
Click to show internal directories.
Click to hide internal directories.