Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrShutdown = errors.New("server shutdown")
)
Functions ¶
Types ¶
type AnyServer ¶
type AnyServer struct { // Handler 处理请求的 Handler,必填 Handler Handler // BeforeAccept Accept 之前的回调,可选 BeforeAccept func(l net.Listener) error // OnConn 创建新链接后的回调,可选 OnConn func(ctx context.Context, conn net.Conn, err error) (context.Context, net.Conn, error) // contains filtered or unexported fields }
AnyServer 一个通用的 server
type CanShutdown ¶
CanShutdown 支持优雅关闭
type GracefulServer ¶ added in v0.0.6
type GracefulServer interface { Server CanShutdown }
GracefulServer 支持优雅关闭的 server
type HandleFunc ¶
Click to show internal directories.
Click to hide internal directories.