重构服务器

This commit is contained in:
kercylan98
2023-04-19 17:13:34 +08:00
parent 45a9d9b4e3
commit 481ccc182a
54 changed files with 946 additions and 1836 deletions

12
server/errors.go Normal file
View File

@@ -0,0 +1,12 @@
package server
import "errors"
var (
ErrConstructed = errors.New("the Server must be constructed using the server.New function")
ErrCanNotSupportNetwork = errors.New("can not support network")
ErrMessageTypePacketAttrs = errors.New("MessageTypePacket must contain *Conn and []byte")
ErrMessageTypeErrorAttrs = errors.New("MessageTypePacket must contain error and MessageErrorAction")
ErrNetworkOnlySupportHttp = errors.New("the current network mode is not compatible with HttpRouter, only NetworkHttp is supported")
ErrNetworkIncompatibleHttp = errors.New("the current network mode is not compatible with NetworkHttp")
)