Documentation ¶
Index ¶
- Constants
- Variables
- func AddFilter(filter ...Filter)
- func EnableAdmin(enabled bool)
- func PathExist(name string) bool
- func Router(uriPattern string, ctrl ControllerInterface, funcName string)
- func Run()
- func SecurityVerify(request *httplib.Request, response *httplib.Response) bool
- func WatchDoTask(callback func(filePath string, event *fsnotify.FileEvent), filePaths ...string)
- type Action
- type AdminController
- type BaseResult
- type Controller
- type ControllerInterface
- type Cotter
- type ErrorController
- type Filter
- type FilterManager
- type ForwardResult
- type JSONResult
- type Model
- type MxGoApp
- type MxLogger
- type PlainResult
- type RedirectResult
- type Result
- type RouterManager
- type StaticController
- type StaticResult
- type TemplateResult
- type XMLResult
Constants ¶
View Source
const ( MxGoVersion = "0.0.1" MxGoServerName = "MxGo" MxGoImportPath = "github.com/menghx/mxgo" )
View Source
const ( FILTER_BEFORE_ACTION = iota FILTER_AFTER_ACTION )
Variables ¶
View Source
var (
AppCfg = app.Cfg
)
Functions ¶
func EnableAdmin ¶
func EnableAdmin(enabled bool)
func Router ¶
func Router(uriPattern string, ctrl ControllerInterface, funcName string)
func SecurityVerify ¶
Types ¶
type Action ¶
type Action struct { CtrlName ControllerInterface FuncName string }
func ErrorAction ¶
func NewAction ¶
func NewAction(ctrlName ControllerInterface, funcName string) Action
type AdminController ¶
type AdminController struct {
Controller
}
type BaseResult ¶
type Controller ¶
func (*Controller) Forward ¶
func (ctrl *Controller) Forward() Result
func (*Controller) Json ¶
func (ctrl *Controller) Json() Result
func (*Controller) Plain ¶
func (ctrl *Controller) Plain() Result
func (*Controller) Redirect ¶
func (ctrl *Controller) Redirect() Result
func (*Controller) Static ¶
func (ctrl *Controller) Static() Result
func (*Controller) Template ¶
func (ctrl *Controller) Template() Result
func (*Controller) XML ¶
func (ctrl *Controller) XML() Result
type ControllerInterface ¶
type ErrorController ¶
type ErrorController struct {
Controller
}
func (ErrorController) Handle ¶
func (errc ErrorController) Handle(errorCode string) Result
type Filter ¶
type Filter interface {
Execute(ctrl *Controller)
}
type FilterManager ¶
type FilterManager struct {
// contains filtered or unexported fields
}
func NewFilterManager ¶
func NewFilterManager() *FilterManager
func (*FilterManager) AddFilter ¶
func (fm *FilterManager) AddFilter(filters ...Filter)
func (*FilterManager) AfterAction ¶
func (fm *FilterManager) AfterAction(ctrl *Controller)
func (*FilterManager) BeforeAction ¶
func (fm *FilterManager) BeforeAction(ctrl *Controller)
type ForwardResult ¶
type ForwardResult struct {
*BaseResult
}
func (ForwardResult) Render ¶
func (result ForwardResult) Render() error
type JSONResult ¶
type JSONResult struct {
*BaseResult
}
func (JSONResult) Render ¶
func (result JSONResult) Render() error
type MxGoApp ¶
type MxGoApp struct { AppName string AppHome string StaticUri string Cfg *config.Config Rm *RouterManager Fm *FilterManager // contains filtered or unexported fields }
func NewMxGoApp ¶
func NewMxGoApp() *MxGoApp
func (*MxGoApp) EnableAdmin ¶
type PlainResult ¶
type PlainResult struct {
*BaseResult
}
func (PlainResult) Render ¶
func (result PlainResult) Render() error
type RedirectResult ¶
type RedirectResult struct {
*BaseResult
}
func (RedirectResult) Render ¶
func (result RedirectResult) Render() error
type RouterManager ¶
type RouterManager struct {
// contains filtered or unexported fields
}
func NewRouterManager ¶
func NewRouterManager() *RouterManager
func (*RouterManager) FindAction ¶
func (*RouterManager) Router ¶
func (rm *RouterManager) Router(uriPattern string, ctrl ControllerInterface, funcName string)
type StaticController ¶
type StaticController struct {
Controller
}
func (StaticController) Handle ¶
func (ctrl StaticController) Handle() Result
type StaticResult ¶
type StaticResult struct {
*BaseResult
}
func (StaticResult) Render ¶
func (result StaticResult) Render() error
type TemplateResult ¶
type TemplateResult struct { *BaseResult // contains filtered or unexported fields }
func (TemplateResult) Render ¶
func (result TemplateResult) Render() error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.