server

package
v0.2.38 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server httpServer类

func NewServer

func NewServer() *Server

NewServer

func (*Server) RegisterRouter

func (s *Server) RegisterRouter(method, relativePath string, handler context.HandlerFunc)

RegisterRouter 注册路由

func (*Server) Router

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

Router 获得路由

func (*Server) Run

func (s *Server) Run(addr ...string) error

Run 启动服务

func (*Server) RunTLS

func (s *Server) RunTLS(certFile, keyFile string, addr ...string) error

RunTLS 启动服务

func (*Server) ServeHTTP

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

ServeHTTP http请求

func (*Server) Shutdown added in v0.0.22

func (s *Server) Shutdown(ctx syscontext.Context) error

Shutdown 关闭服务

func (*Server) Tmpl

func (s *Server) Tmpl() *tmpl.Tmpl

Tmpl 获得模板对象

Jump to

Keyboard shortcuts

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