Documentation
¶
Index ¶
- func MiddlewareAdapter(m middleware.Middleware) mist.Middleware
- type HTTPServer
- func (s *HTTPServer) DELETE(path string, handler mist.HandleFunc)
- func (s *HTTPServer) Endpoint() (*url.URL, error)
- func (s *HTTPServer) GET(path string, handler mist.HandleFunc)
- func (s *HTTPServer) GetEngine() *mist.HTTPServer
- func (s *HTTPServer) Group(prefix string) interface{}
- func (s *HTTPServer) POST(path string, handler mist.HandleFunc)
- func (s *HTTPServer) PUT(path string, handler mist.HandleFunc)
- func (s *HTTPServer) Start(ctx context.Context) error
- func (s *HTTPServer) Stop(ctx context.Context) error
- func (s *HTTPServer) UseMiddleware(middleware ...middleware.Middleware)
- type HTTPServerOption
- type Server
- type ServerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MiddlewareAdapter ¶
func MiddlewareAdapter(m middleware.Middleware) mist.Middleware
MiddlewareAdapter 将phantasm中间件适配到mist中间件
Types ¶
type HTTPServer ¶
type HTTPServer struct {
// contains filtered or unexported fields
}
HTTPServer 是HTTP服务器
func NewHTTPServer ¶
func NewHTTPServer(opts ...HTTPServerOption) (*HTTPServer, error)
NewHTTPServer 创建一个新的HTTP服务器
func (*HTTPServer) DELETE ¶
func (s *HTTPServer) DELETE(path string, handler mist.HandleFunc)
DELETE 注册DELETE方法处理程序
func (*HTTPServer) Endpoint ¶
func (s *HTTPServer) Endpoint() (*url.URL, error)
Endpoint 返回HTTP服务器的URL端点
func (*HTTPServer) GET ¶
func (s *HTTPServer) GET(path string, handler mist.HandleFunc)
GET 注册GET方法处理程序
func (*HTTPServer) GetEngine ¶ added in v0.2.4
func (s *HTTPServer) GetEngine() *mist.HTTPServer
GetEngine 返回内部的mist HTTP服务器引擎
func (*HTTPServer) POST ¶
func (s *HTTPServer) POST(path string, handler mist.HandleFunc)
POST 注册POST方法处理程序
func (*HTTPServer) PUT ¶
func (s *HTTPServer) PUT(path string, handler mist.HandleFunc)
PUT 注册PUT方法处理程序
func (*HTTPServer) UseMiddleware ¶
func (s *HTTPServer) UseMiddleware(middleware ...middleware.Middleware)
UseMiddleware 在HTTP服务器上使用Phantasm中间件
type Server ¶
type Server struct {
*mist.HTTPServer
// contains filtered or unexported fields
}
Server 是HTTP服务器
type ServerOption ¶
type ServerOption func(*Server)
ServerOption 是HTTP服务器选项
func Address ¶
func Address(address string) ServerOption
Address 设置地址,例如 ":8000", "127.0.0.1:8000" 等
func Network ¶
func Network(network string) ServerOption
Network 设置网络类型,例如 "tcp", "tcp4", "tcp6", "unix" 或 "unixpacket"
func SetHTTPServer ¶
func SetHTTPServer(server *mist.HTTPServer) ServerOption
SetHTTPServer 设置Mist HTTP服务器
Click to show internal directories.
Click to hide internal directories.