Documentation ¶
Index ¶
- Constants
- func ListenDefault(r *LionRouter)
- type BaseController
- func (c *BaseController) Delete(f interface{}, paramsOrder ...string) *BaseController
- func (c *BaseController) FuncRun(method string, params *Parameters, req *http.Request) (*[]byte, *exception.Exception)
- func (c *BaseController) Get(f interface{}, paramsOrder ...string) *BaseController
- func (c *BaseController) Post(f interface{}, paramsOrder ...string) *BaseController
- func (c *BaseController) Put(f interface{}, paramsOrder ...string) *BaseController
- func (c *BaseController) WebSocket(w http.ResponseWriter, req *http.Request, params *map[string]string)
- type Config
- type Context
- type HandleFunction
- type HandleFunctions
- type ILionController
- type IParams
- type LionRouter
- type Parameters
- type RouterItem
Constants ¶
View Source
const ( BodyTag = "route_body" ContextTag = "route_ctx" )
Variables ¶
This section is empty.
Functions ¶
func ListenDefault ¶
func ListenDefault(r *LionRouter)
ListenDefault is to start listen by this route default instance.
Types ¶
type BaseController ¶
type BaseController struct { ResetReturn func(data *interface{}, ex *exception.Exception) (*[]byte, *exception.Exception) // contains filtered or unexported fields }
func InitController ¶
func InitController(route string) *BaseController
func (*BaseController) Delete ¶
func (c *BaseController) Delete(f interface{}, paramsOrder ...string) *BaseController
func (*BaseController) FuncRun ¶
func (c *BaseController) FuncRun(method string, params *Parameters, req *http.Request) (*[]byte, *exception.Exception)
func (*BaseController) Get ¶
func (c *BaseController) Get(f interface{}, paramsOrder ...string) *BaseController
func (*BaseController) Post ¶
func (c *BaseController) Post(f interface{}, paramsOrder ...string) *BaseController
func (*BaseController) Put ¶
func (c *BaseController) Put(f interface{}, paramsOrder ...string) *BaseController
func (*BaseController) WebSocket ¶
func (c *BaseController) WebSocket(w http.ResponseWriter, req *http.Request, params *map[string]string)
type HandleFunction ¶
type HandleFunctions ¶
type HandleFunctions map[int]HandleFunction
type ILionController ¶
type ILionController interface { FuncRun(method string, params *Parameters, req *http.Request) (*[]byte, *exception.Exception) Get(function interface{}, paramsorder ...string) *BaseController Post(function interface{}, paramsorder ...string) *BaseController Put(function interface{}, paramsorder ...string) *BaseController Delete(function interface{}, paramsorder ...string) *BaseController WebSocket(w http.ResponseWriter, req *http.Request, params *map[string]string) }
type LionRouter ¶
type LionRouter struct {
// contains filtered or unexported fields
}
func InitRouter ¶
func InitRouter(c *Config) *LionRouter
Default is get this route default instance.
func (*LionRouter) Register ¶
func (r *LionRouter) Register(c *BaseController)
Register is to registe these URL into default route, then when linsen the default route.
func (*LionRouter) ServeHTTP ¶
func (r *LionRouter) ServeHTTP(w http.ResponseWriter, req *http.Request)
type Parameters ¶
type Parameters struct { ParamNum int HasBody bool ParamsOrder *[]string ParamsType *[]reflect.Type ParamsFill []bool FillOrder []string ParamsData *map[string]string }
func (*Parameters) AddParamData ¶
func (p *Parameters) AddParamData(name string, value string)
func (*Parameters) RmoveParamData ¶
func (p *Parameters) RmoveParamData(name string)
type RouterItem ¶
type RouterItem struct { Route string Controller ILionController }
Click to show internal directories.
Click to hide internal directories.