Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Host string
Port string
Uri string //路由
ReadBufferSize int //IO读缓冲区
WriteBufferSize int //IO写缓冲区
CheckOrigin bool //是否检查跨域 true:不允许跨域,false:允许跨域
MaxLiveTime int64 //连接最大生存时间 心跳要小于这个值
MaxWriteWaitTime time.Duration //推送消息最大等待时间
MaxReadWaitTime time.Duration //读取消息最大的等待时间
MaxMessageSize int64 //消息最大byte
MaxClient int //最大的客户端数
}
type GsMessageItem ¶
GsMessageItem 消息体
type GsWsClient ¶
type GsWsClient struct {
Host string
Port string
Uri string
RecMsgChan chan string
CallFunc func(string) string
}
func (*GsWsClient) SetCallFunc ¶
func (h *GsWsClient) SetCallFunc(callFunc func(string) string)
SetCallFunc 设置回调
func (*GsWsClient) Start ¶
func (h *GsWsClient) Start() error
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server 服务总配置
func (*Server) SetConnCloseFunc ¶
SetConnCloseFunc 连接关闭回调
func (*Server) SetGClientIdFunc ¶
SetGClientIdFunc 获取clientId回调
func (*Server) SetNewConnFunc ¶
SetNewConnFunc 新连接回调
type WsConn ¶
type WsConn struct {
// contains filtered or unexported fields
}
WsConn 客户端连接配置
func (*WsConn) SendMessage ¶
SendMessage 写入消息到队列中
func (*WsConn) SetReceiveFunc ¶
SetReceiveFunc 设置回调方法
Click to show internal directories.
Click to hide internal directories.