完成基本的server启动以及example

This commit is contained in:
2021-03-28 16:04:42 +08:00
parent b0814c443a
commit c41a7c4671
7 changed files with 342 additions and 28 deletions

View File

@ -7,7 +7,9 @@
// Date : 2021-03-27 6:32 下午
package abstract
import "github.com/go-developer/websocket/context"
import (
"github.com/go-developer/websocket/context"
)
// IWebsocket 接口约束
//
@ -27,24 +29,24 @@ type IWebsocket interface {
//
// Date : 6:40 下午 2021/3/27
Disconnect(ctx *context.WSContext)
// Message 收到客户端指令时处理的方法
// Close 关闭连接
//
// Author : go_developer@163.com<张德满>
//
// Date : 6:40 下午 2021/3/27
Message(ctx *context.WSContext)
// Date : 8:43 下午 2021/3/27
Close(ctx *context.WSContext, code int, message string) error
// HandshakeURL 注册的websocket路由
//
// Author : go_developer@163.com<张德满>
//
// Date : 6:45 下午 2021/3/27
HandshakeURL() []string
// RegisterCommand 注册长连接模块支持的命令
// GetCommandList 注册长连接模块支持的命令
//
// Author : go_developer@163.com<张德满>
//
// Date : 6:48 下午 2021/3/27
RegisterCommand()
GetCommandList() []ICommand
// GetModuleFlag 获取模块标识,全局唯一
//
// Author : go_developer@163.com<张德满>