Help us shape the future of Go! Take the 2026 Go Developer Survey

mocknet

package
v1.12.19 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 6 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 {
	*websocket.Server // 复用 websocket.Server 的连接管理
	// contains filtered or unexported fields
}

Server 测试用 Mock WebSocket 服务端(基于 httptest) 嵌入 *websocket.Server 复用连接管理(Add/Get/Bind/Unbind/Send)

func New

func New() *Server

NewServer 创建 Mock 服务端

func (*Server) Close

func (d *Server) Close()

Close 关闭 Mock 服务端

func (*Server) Init

func (d *Server) Init(addr string) error

Init 初始化并启动 Mock WebSocket 服务(实现 INetwork 接口)

Jump to

Keyboard shortcuts

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