Documentation ¶
Index ¶
- func AsyncCallLen(value int) func(s *serverconfig)
- func EventChanLen(value int) func(s *serverconfig)
- func HTTPHandleFuncs(handles ...HTTPHandleFunc) func(s *serverconfig)
- func HTTPHandlers(handles ...HTTPHandler) func(s *serverconfig)
- func HTTPTimeout(value int) func(s *serverconfig)
- func Keepalived(interval, limit int) func(s *serverconfig)
- func Listen(addr string) func(s *serverconfig)
- func MaxConnectNumber(fn func() int) func(s *serverconfig)
- func MaxMsgLen(value int) func(s *serverconfig)
- func MsgLenBytes(value int) func(s *serverconfig)
- func NewAgent(id int64, conn union.Conn, mgr iMgr) hotpot.IAgent
- func ReadTimeOut(value int) func(s *serverconfig)
- func SSL(certFile, keyFile string) func(s *serverconfig)
- func Schema(schema string) func(s *serverconfig)
- func Serialize(value codec.Type) func(s *serverconfig)
- func Serve(addr string, options ...Option) hotpot.IAgentMgr
- func StaticMaxConnectNumber(value int) func(s *serverconfig)
- func TextMsg(enable bool) func(s *serverconfig)
- type AgentMgr
- func (am *AgentMgr) AddAgent(a hotpot.IAgent)
- func (am *AgentMgr) Agents() []hotpot.IAgent
- func (am *AgentMgr) DelAgent(a hotpot.IAgent)
- func (am *AgentMgr) Error(cb func(err error) union.Conn)
- func (am *AgentMgr) Get(id int64) hotpot.IAgent
- func (am *AgentMgr) IsServerRuning() bool
- func (am *AgentMgr) Len() (count int)
- func (am *AgentMgr) OnError(err error) union.Conn
- func (am *AgentMgr) OnReceived(msg []byte) []byte
- func (am *AgentMgr) OnSend(msg []byte, keepalived bool) []byte
- func (am *AgentMgr) Received(cb func(msg []byte) []byte)
- func (am *AgentMgr) Send(cb func(msg []byte, keepalived bool) []byte)
- func (am *AgentMgr) Shutdown(immediately bool)
- type HTTPHandleFunc
- type HTTPHandler
- type Option
- type TCPServer
- func (ts *TCPServer) Listen() string
- func (ts *TCPServer) RecvChanLen() int
- func (ts *TCPServer) SendChanLen() int
- func (ts *TCPServer) SerializeType() codec.Type
- func (ts *TCPServer) Serializer() codec.Serializer
- func (ts *TCPServer) Shutdown(immediately bool)
- func (ts *TCPServer) Start()
- func (ts *TCPServer) WSControlType() union.ControlType
- type WSServer
- func (wss *WSServer) Listen() string
- func (wss *WSServer) RecvChanLen() int
- func (wss *WSServer) SendChanLen() int
- func (wss *WSServer) SerializeType() codec.Type
- func (wss *WSServer) Serializer() codec.Serializer
- func (wss *WSServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (wss *WSServer) Shutdown(immediately bool)
- func (wss *WSServer) Start()
- func (wss *WSServer) WSControlType() union.ControlType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsyncCallLen ¶
func AsyncCallLen(value int) func(s *serverconfig)
func EventChanLen ¶
func EventChanLen(value int) func(s *serverconfig)
func HTTPHandleFuncs ¶
func HTTPHandleFuncs(handles ...HTTPHandleFunc) func(s *serverconfig)
func HTTPHandlers ¶
func HTTPHandlers(handles ...HTTPHandler) func(s *serverconfig)
func HTTPTimeout ¶
func HTTPTimeout(value int) func(s *serverconfig)
func Keepalived ¶
func Keepalived(interval, limit int) func(s *serverconfig)
func MaxConnectNumber ¶
func MaxConnectNumber(fn func() int) func(s *serverconfig)
func MsgLenBytes ¶
func MsgLenBytes(value int) func(s *serverconfig)
func ReadTimeOut ¶
func ReadTimeOut(value int) func(s *serverconfig)
func StaticMaxConnectNumber ¶
func StaticMaxConnectNumber(value int) func(s *serverconfig)
Types ¶
type AgentMgr ¶
AgentMgr 服务器基础类
func (*AgentMgr) IsServerRuning ¶
IsServerRuning 查询服务器是否启动(监听)
type HTTPHandleFunc ¶
type HTTPHandleFunc struct { Pattern string Handle func(http.ResponseWriter, *http.Request) }
type HTTPHandler ¶
type TCPServer ¶
type TCPServer struct { *AgentMgr // contains filtered or unexported fields }
TCPServer 服务器
func (*TCPServer) RecvChanLen ¶
func (*TCPServer) SendChanLen ¶
func (*TCPServer) SerializeType ¶
Serializer 消息序列化类型
func (*TCPServer) Serializer ¶
func (ts *TCPServer) Serializer() codec.Serializer
Serializer 消息序列化方式
func (*TCPServer) WSControlType ¶
func (ts *TCPServer) WSControlType() union.ControlType
websocket 控制类型
type WSServer ¶
type WSServer struct { *AgentMgr // contains filtered or unexported fields }
WSServer websocket服务
func (*WSServer) RecvChanLen ¶
func (*WSServer) SendChanLen ¶
func (*WSServer) SerializeType ¶
func (*WSServer) WSControlType ¶
func (wss *WSServer) WSControlType() union.ControlType
websocket 控制类型
Click to show internal directories.
Click to hide internal directories.