Documentation
¶
Index ¶
- type Context
- type Controller
- type Group
- type IContext
- type IGroup
- type Server
- func (c *Server) Delete(url string, handler Controller)
- func (c *Server) FindRouteByRequest(request *http.Request) Controller
- func (c *Server) Get(url string, handler Controller)
- func (s *Server) Group(prefix string) IGroup
- func (c *Server) Post(url string, handler Controller)
- func (c *Server) Put(url string, handler Controller)
- func (s *Server) Run(addr ...string) error
- func (s *Server) ServeHTTP(resp http.ResponseWriter, req *http.Request)
- type Tree
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func (*Context) ResponseString ¶
type Controller ¶
func TimeoutHandler ¶
func TimeoutHandler(fun Controller, d time.Duration) Controller
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group struct 实现了IGroup
func (*Group) Delete ¶
func (g *Group) Delete(uri string, handler Controller)
func (*Group) Get ¶
func (g *Group) Get(uri string, handler Controller)
func (*Group) Post ¶
func (g *Group) Post(uri string, handler Controller)
func (*Group) Put ¶
func (g *Group) Put(uri string, handler Controller)
type IGroup ¶
type IGroup interface { Get(string, Controller) Post(string, Controller) Put(string, Controller) Delete(string, Controller) }
IGroup 代表前缀分组
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) Delete ¶
func (c *Server) Delete(url string, handler Controller)
func (*Server) FindRouteByRequest ¶
func (c *Server) FindRouteByRequest(request *http.Request) Controller
FindRouteByRequest 匹配路由,如果没有匹配到,返回nil
func (*Server) Get ¶
func (c *Server) Get(url string, handler Controller)
func (*Server) Post ¶
func (c *Server) Post(url string, handler Controller)
func (*Server) Put ¶
func (c *Server) Put(url string, handler Controller)
Click to show internal directories.
Click to hide internal directories.