Documentation
¶
Index ¶
- type ServerHTTP
- type ServerRPC
- func (T *ServerRPC) Close() error
- func (T *ServerRPC) HandleHTTP(rpcPath, debugPath string)
- func (T *ServerRPC) ListenAndServe() error
- func (T *ServerRPC) LoadTLS(certFile, keyFile string) error
- func (T *ServerRPC) Register(value any)
- func (T *ServerRPC) RegisterName(name string, rcvr any) error
- func (T *ServerRPC) Serve(l net.Listener) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServerHTTP ¶
type ServerHTTP struct {
*http.Server // HTTP
Addr string // 监听地址
Route *vweb.Route // 路由表
AutoCert *autocert.Manager // 自动申请证书
// contains filtered or unexported fields
}
ServerHTTP 服务器HTTP
func (*ServerHTTP) ListenAndServe ¶
func (T *ServerHTTP) ListenAndServe() error
ListenAndServe 监听并启动
error 错误
func (*ServerHTTP) LoadTLS ¶
func (T *ServerHTTP) LoadTLS(certFile, keyFile string) error
LoadTLS 加载证书文件
certFile 证书公钥 keyFile 证书私钥
type ServerRPC ¶
type ServerRPC struct {
*rpc.Server
Addr string
AutoCert *autocert.Manager
Handle codec.Handle
// contains filtered or unexported fields
}
ServerRPC 服务器,基于 ugorji/go/codec 的 RPC 服务端。
Handle 为编解码配置,必须与客户端一致。为 nil 时使用共享的 MsgpackHandle。 若需支持接口字段,请在 Handle 上配置 MapType / SetExt;客户端需相同配置。
func (*ServerRPC) HandleHTTP ¶
HandleHTTP 开启 HTTP CONNECT 隧道模式并记录路由。 客户端必须发送 CONNECT <rpcPath> 才能切换到 RPC 协议。 debugPath 非空时提供只读的已注册服务列表。
func (*ServerRPC) RegisterName ¶
RegisterName 注册服务对象,并记录用于 debug 页展示。
Click to show internal directories.
Click to hide internal directories.