server

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type After added in v1.1.1

type After func(stream *http.Stream) exception.Error

type Before added in v1.1.1

type Before func(stream *http.Stream) (lemo.Context, exception.Error)

type Middle

type Middle func(*http2.Stream)

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) Group

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

func (*Router) Route

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

func (*Router) SetDefaultIndex

func (router *Router) SetDefaultIndex(index string)

func (*Router) SetGlobalAfter added in v1.1.1

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

func (*Router) SetGlobalBefore added in v1.1.1

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

func (*Router) SetStaticPath

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

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
}

func (*Server) GetRouter

func (h *Server) GetRouter() *Router

func (*Server) LocalAddr added in v1.1.1

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

func (*Server) Ready

func (h *Server) Ready()

func (*Server) ServeHTTP

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

func (*Server) SetRouter

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

func (*Server) Shutdown

func (h *Server) Shutdown()

func (*Server) Start

func (h *Server) Start()

Start Http

func (*Server) Use

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL