Documentation
¶
Index ¶
- type After
- type Before
- type Middle
- type RouteHandler
- func (handler *RouteHandler) Delete(path string) *route
- func (handler *RouteHandler) Get(path string) *route
- func (handler *RouteHandler) Option(path string) *route
- func (handler *RouteHandler) Patch(path string) *route
- func (handler *RouteHandler) Post(path string) *route
- func (handler *RouteHandler) Put(path string) *route
- func (handler *RouteHandler) Route(method string, path string) *route
- type Router
- func (router *Router) GetAllRouters() []*node
- func (router *Router) Group(path ...string) *group
- func (router *Router) Route(method string, path string) *route
- func (router *Router) SetDefaultIndex(index string)
- func (router *Router) SetGlobalAfter(after ...After)
- func (router *Router) SetGlobalBefore(before ...Before)
- func (router *Router) SetStaticPath(prefixPath string, staticPath string)
- type Server
- func (h *Server) GetRouter() *Router
- func (h *Server) LocalAddr() net.Addr
- func (h *Server) Ready()
- func (h *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (h *Server) SetRouter(router *Router) *Server
- func (h *Server) Shutdown()
- func (h *Server) Start()
- func (h *Server) Use(middle ...func(next Middle) Middle)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RouteHandler ¶
type RouteHandler struct {
// contains filtered or unexported fields
}
func (*RouteHandler) Delete ¶
func (handler *RouteHandler) Delete(path string) *route
func (*RouteHandler) Get ¶
func (handler *RouteHandler) Get(path string) *route
func (*RouteHandler) Option ¶
func (handler *RouteHandler) Option(path string) *route
func (*RouteHandler) Patch ¶
func (handler *RouteHandler) Patch(path string) *route
func (*RouteHandler) Post ¶
func (handler *RouteHandler) Post(path string) *route
func (*RouteHandler) Put ¶
func (handler *RouteHandler) Put(path string) *route
func (*RouteHandler) Route ¶
func (handler *RouteHandler) Route(method string, path string) *route
type Router ¶
type Router struct {
IgnoreCase bool
// contains filtered or unexported fields
}
func (*Router) GetAllRouters ¶
func (router *Router) GetAllRouters() []*node
func (*Router) SetDefaultIndex ¶
func (*Router) SetGlobalAfter ¶ added in v1.1.1
func (*Router) SetGlobalBefore ¶ added in v1.1.1
func (*Router) SetStaticPath ¶
type Server ¶
type Server struct {
Name string
// Host 服务Host
Host string
// IP
IP string
// Port 服务端口
Port int
// Protocol 协议
TSL bool
// TLS FILE
CertFile string
// TLS KEY
KeyFile string
// AutoBind
AutoBind bool
OnOpen func(stream *http2.Stream)
OnMessage func(stream *http2.Stream)
OnClose func(stream *http2.Stream)
OnError func(stream *http2.Stream, err exception.Error)
OnSuccess func()
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.