Documentation ¶
Index ¶
- func CheckOrigin(_ *http.Request) bool
- func GetNetListener(address, certFile, keyFile string) (net.Listener, error)
- type Component
- type ConnectStat
- func (c *ConnectStat) Add(info *LoginRecord)
- func (c *ConnectStat) ConnCount() int64
- func (c *ConnectStat) DecreaseConn()
- func (c *ConnectStat) IncreaseConn()
- func (c *ConnectStat) LoginCount() int64
- func (c *ConnectStat) LoginRecords() map[facade.UID]*LoginRecord
- func (c *ConnectStat) PrintInfo() string
- func (c *ConnectStat) Remove(uid facade.UID)
- type LoginRecord
- type TCPConnector
- type WSConnector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Component ¶ added in v1.1.0
type Component struct { facade.Component ConnectStat *ConnectStat // contains filtered or unexported fields }
Component (连接器组件适用于前端节点)
func NewComponent ¶ added in v1.1.5
func NewComponent(connector facade.IConnector) *Component
func (*Component) OnAfterInit ¶ added in v1.1.0
func (c *Component) OnAfterInit()
func (*Component) OnConnect ¶ added in v1.1.5
func (c *Component) OnConnect(listener ...facade.OnConnectListener)
type ConnectStat ¶ added in v1.1.0
ConnectStat 连接统计
func (*ConnectStat) Add ¶ added in v1.1.0
func (c *ConnectStat) Add(info *LoginRecord)
func (*ConnectStat) ConnCount ¶ added in v1.1.0
func (c *ConnectStat) ConnCount() int64
func (*ConnectStat) DecreaseConn ¶ added in v1.1.0
func (c *ConnectStat) DecreaseConn()
func (*ConnectStat) IncreaseConn ¶ added in v1.1.0
func (c *ConnectStat) IncreaseConn()
func (*ConnectStat) LoginCount ¶ added in v1.1.0
func (c *ConnectStat) LoginCount() int64
func (*ConnectStat) LoginRecords ¶ added in v1.1.0
func (c *ConnectStat) LoginRecords() map[facade.UID]*LoginRecord
func (*ConnectStat) PrintInfo ¶ added in v1.1.0
func (c *ConnectStat) PrintInfo() string
func (*ConnectStat) Remove ¶ added in v1.1.0
func (c *ConnectStat) Remove(uid facade.UID)
type LoginRecord ¶
type LoginRecord struct {
// contains filtered or unexported fields
}
LoginRecord 登录记录器
type TCPConnector ¶
type TCPConnector struct {
// contains filtered or unexported fields
}
func NewTCP ¶ added in v1.1.0
func NewTCP(address string) *TCPConnector
func NewTCPLTS ¶ added in v1.1.0
func NewTCPLTS(address, certFile, keyFile string) *TCPConnector
func (*TCPConnector) OnConnect ¶
func (t *TCPConnector) OnConnect(listener ...cherryFacade.OnConnectListener)
func (*TCPConnector) OnStart ¶ added in v1.1.0
func (t *TCPConnector) OnStart()
func (*TCPConnector) OnStop ¶ added in v1.1.0
func (t *TCPConnector) OnStop()
OnStop stops the connector
type WSConnector ¶ added in v1.1.0
type WSConnector struct {
// contains filtered or unexported fields
}
func NewWS ¶ added in v1.1.0
func NewWS(address string) *WSConnector
func NewWebsocketLTS ¶ added in v1.1.0
func NewWebsocketLTS(address, certFile, keyFile string) *WSConnector
func (*WSConnector) OnConnect ¶ added in v1.1.0
func (w *WSConnector) OnConnect(listener ...cherryFacade.OnConnectListener)
func (*WSConnector) OnStart ¶ added in v1.1.0
func (w *WSConnector) OnStart()
func (*WSConnector) OnStop ¶ added in v1.1.0
func (w *WSConnector) OnStop()
func (*WSConnector) ServeHTTP ¶ added in v1.1.0
func (w *WSConnector) ServeHTTP(rw http.ResponseWriter, r *http.Request)
ServerHTTP server.Handler
Click to show internal directories.
Click to hide internal directories.