Documentation ¶
Index ¶
- type After
- type Before
- type Middle
- type RouteHandler
- func (rh *RouteHandler) Delete(path ...string) *route
- func (rh *RouteHandler) Get(path ...string) *route
- func (rh *RouteHandler) Option(path ...string) *route
- func (rh *RouteHandler) Patch(path ...string) *route
- func (rh *RouteHandler) Post(path ...string) *route
- func (rh *RouteHandler) Put(path ...string) *route
- func (rh *RouteHandler) Remove(path ...string)
- func (rh *RouteHandler) Route(method string, path ...string) *route
- type Router
- func (r *Router) GetAllRouters() []*node
- func (r *Router) Group(path ...string) *group
- func (r *Router) Remove(path ...string)
- func (r *Router) Route(method string, path ...string) *route
- func (r *Router) SetDefaultIndex(index ...string)
- func (r *Router) SetGlobalAfter(after ...After)
- func (r *Router) SetGlobalBefore(before ...Before)
- func (r *Router) SetOpenDir(dirIndex ...int)
- func (r *Router) SetStaticDirMiddle(t ...string) *StaticDirMiddle
- func (r *Router) SetStaticDownload(flag bool)
- func (r *Router) SetStaticFileMiddle(t ...string) *StaticFileMiddle
- func (r *Router) SetStaticGlobalDirMiddle(...)
- func (r *Router) SetStaticGlobalFileMiddle(...)
- func (r *Router) SetStaticPath(prefixPath string, fixPath string, fileSystem http2.FileSystem) int
- type Server
- func (s *Server) GetRouter() *Router
- func (s *Server) LocalAddr() net.Addr
- func (s *Server) Ready()
- func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (s *Server) SetRouter(router *Router) *Server
- func (s *Server) Shutdown() error
- func (s *Server) Start()
- func (s *Server) Use(middle ...func(next Middle) Middle)
- type Static
- type StaticDirMiddle
- type StaticFileMiddle
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 (rh *RouteHandler) Delete(path ...string) *route
func (*RouteHandler) Get ¶
func (rh *RouteHandler) Get(path ...string) *route
func (*RouteHandler) Option ¶
func (rh *RouteHandler) Option(path ...string) *route
func (*RouteHandler) Patch ¶
func (rh *RouteHandler) Patch(path ...string) *route
func (*RouteHandler) Post ¶
func (rh *RouteHandler) Post(path ...string) *route
func (*RouteHandler) Put ¶
func (rh *RouteHandler) Put(path ...string) *route
func (*RouteHandler) Remove ¶
func (rh *RouteHandler) Remove(path ...string)
func (*RouteHandler) Route ¶
func (rh *RouteHandler) Route(method string, path ...string) *route
type Router ¶
type Router struct { StrictMode bool // contains filtered or unexported fields }
func (*Router) GetAllRouters ¶
func (r *Router) GetAllRouters() []*node
func (*Router) SetDefaultIndex ¶
func (*Router) SetGlobalAfter ¶
func (*Router) SetGlobalBefore ¶
func (*Router) SetOpenDir ¶
func (*Router) SetStaticDirMiddle ¶
func (r *Router) SetStaticDirMiddle(t ...string) *StaticDirMiddle
func (*Router) SetStaticDownload ¶
func (*Router) SetStaticFileMiddle ¶
func (r *Router) SetStaticFileMiddle(t ...string) *StaticFileMiddle
func (*Router) SetStaticGlobalDirMiddle ¶
func (*Router) SetStaticGlobalFileMiddle ¶
func (*Router) SetStaticPath ¶
type Server ¶
type Server struct { Name string // Host 服务Host Addr string // TLS FILE CertFile string // TLS KEY KeyFile string OnOpen func(stream *http2.Stream) OnMessage func(stream *http2.Stream) OnClose func(stream *http2.Stream) OnError func(stream *http2.Stream, err error) OnSuccess func() ReadTimeout time.Duration WriteTimeout time.Duration // contains filtered or unexported fields }
type StaticDirMiddle ¶
type StaticDirMiddle struct {
// contains filtered or unexported fields
}
type StaticFileMiddle ¶
type StaticFileMiddle struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.