Version: v0.0.0-...-ed4ccba Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2021 License: Apache-2.0 Imports: 14 Imported by: 1




This section is empty.


This section is empty.


This section is empty.


type After

type After func(stream *http.Stream) error

type Before

type Before func(stream *http.Stream) error

type Middle

type Middle func(*http2.Stream)

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 {
	IgnoreCase bool
	// contains filtered or unexported fields

func (*Router) GetAllRouters

func (r *Router) GetAllRouters() []*node

func (*Router) Group

func (r *Router) Group(path ...string) *group

func (*Router) Remove

func (r *Router) Remove(path ...string)

func (*Router) Route

func (r *Router) Route(method string, path string) *route

func (*Router) SetDefaultIndex

func (r *Router) SetDefaultIndex(index string)

func (*Router) SetGlobalAfter

func (r *Router) SetGlobalAfter(after ...After)

func (*Router) SetGlobalBefore

func (r *Router) SetGlobalBefore(before ...Before)

func (*Router) SetStaticPath

func (r *Router) SetStaticPath(prefixPath string, staticPath string)

type Server

type Server struct {
	Name string
	// Host 服务Host
	Addr string
	// Protocol 协议
	TLS bool
	CertFile string
	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()
	// contains filtered or unexported fields

func (*Server) GetRouter

func (s *Server) GetRouter() *Router

func (*Server) LocalAddr

func (s *Server) LocalAddr() net.Addr

func (*Server) Ready

func (s *Server) Ready()

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Server) SetRouter

func (s *Server) SetRouter(router *Router) *Server

func (*Server) Shutdown

func (s *Server) Shutdown() error

func (*Server) Start

func (s *Server) Start()

Start Http

func (*Server) Use

func (s *Server) Use(middle ...func(next Middle) Middle)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL