Documentation ¶
Index ¶
- type Client
- type ClientConn
- func (dl *ClientConn) Accept(ctx network.Context)
- func (dl *ClientConn) ClientID() *network.ClientID
- func (dl *ClientConn) Closed(ctx network.Context)
- func (dl *ClientConn) Destory()
- func (dl *ClientConn) Ping(ctx network.Context)
- func (dl *ClientConn) Post(message interface{}) error
- func (dl *ClientConn) Recvice(ctx network.Context)
- func (dl *ClientConn) Secret() []byte
- type Encryption
- type Gateway
- func (g *Gateway) FindRouter(message proto.Message) *router.Router
- func (g *Gateway) GetClient(cid *network.ClientID) Client
- func (g *Gateway) NewClientID(id string) *network.ClientID
- func (g *Gateway) Register(cid *network.ClientID, l Client) error
- func (g *Gateway) ReleaseClient(c Client)
- func (g *Gateway) Start() error
- func (g *Gateway) Stop() error
- func (g *Gateway) UnRegister(cid *network.ClientID)
- type GatewayClientPool
- type GatewayConfig
- type GatewayConfigOption
- func WithClientPool(pool GatewayClientPool) GatewayConfigOption
- func WithKleepalive(timeout int32) GatewayConfigOption
- func WithKleepaliveServant(timeout int32) GatewayConfigOption
- func WithLAddr(laddr string) GatewayConfigOption
- func WithLAddrServant(laddr string) GatewayConfigOption
- func WithNewEncryption(newFunc func() *Encryption) GatewayConfigOption
- func WithNewSystem(newFunc func(options ...network.ConfigOption) *network.NetworkSystem) GatewayConfigOption
- func WithOnlineOfNumber(number int) GatewayConfigOption
- func WithRoute(router *router.RouterConfig) GatewayConfigOption
- func WithVAddr(vaddr string) GatewayConfigOption
- type GatewayServantActor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientConn ¶
type ClientConn struct {
// contains filtered or unexported fields
}
func (*ClientConn) Accept ¶
func (dl *ClientConn) Accept(ctx network.Context)
func (*ClientConn) ClientID ¶
func (dl *ClientConn) ClientID() *network.ClientID
func (*ClientConn) Closed ¶
func (dl *ClientConn) Closed(ctx network.Context)
func (*ClientConn) Destory ¶
func (dl *ClientConn) Destory()
func (*ClientConn) Ping ¶
func (dl *ClientConn) Ping(ctx network.Context)
func (*ClientConn) Post ¶
func (dl *ClientConn) Post(message interface{}) error
func (*ClientConn) Recvice ¶
func (dl *ClientConn) Recvice(ctx network.Context)
func (*ClientConn) Secret ¶
func (dl *ClientConn) Secret() []byte
type Encryption ¶
type Gateway ¶
type Gateway struct { System *network.NetworkSystem Config *GatewayConfig // contains filtered or unexported fields }
Gateway 网关
func New ¶
func New(options ...GatewayConfigOption) *Gateway
func (*Gateway) FindRouter ¶
FindRouter 查询路由
func (*Gateway) NewClientID ¶
NewClientID 创建客户端连接者ID
func (*Gateway) ReleaseClient ¶
func (*Gateway) UnRegister ¶
type GatewayClientPool ¶
func NewDefaultGatewayClientPool ¶
func NewDefaultGatewayClientPool(g *Gateway) GatewayClientPool
type GatewayConfig ¶
type GatewayConfig struct { VAddr string LAddr string LAddrServant string NewNetworkSystem func(options ...network.ConfigOption) *network.NetworkSystem ClientPool GatewayClientPool NewEncryption func() *Encryption Kleepalive int32 KleepaliveServant int32 // RequestDefautTimeout int64 OnlineOfNumber int Router *router.RouterConfig }
GatewayConfig 网关配置信息
func Configure ¶
func Configure(options ...GatewayConfigOption) *GatewayConfig
type GatewayConfigOption ¶
type GatewayConfigOption func(option *GatewayConfig)
GatewayConfigOption 是一个配置网关参数的函数
func WithClientPool ¶
func WithClientPool(pool GatewayClientPool) GatewayConfigOption
WithClientPool 设置客户端池
func WithKleepalive ¶
func WithKleepalive(timeout int32) GatewayConfigOption
WithNetworkTimeout 设置客户端网络连接保活时间
func WithKleepaliveServant ¶
func WithKleepaliveServant(timeout int32) GatewayConfigOption
WithKleepaliveServant 设置内部服务网络连接保活时间
func WithLAddr ¶
func WithLAddr(laddr string) GatewayConfigOption
func WithLAddrServant ¶
func WithLAddrServant(laddr string) GatewayConfigOption
func WithNewEncryption ¶
func WithNewEncryption(newFunc func() *Encryption) GatewayConfigOption
WithNewEncryption 设置密钥交换算法对象创建函数
func WithNewSystem ¶
func WithNewSystem(newFunc func(options ...network.ConfigOption) *network.NetworkSystem) GatewayConfigOption
func WithOnlineOfNumber ¶
func WithOnlineOfNumber(number int) GatewayConfigOption
WithOnlineOfNumber 设置最大在线人数
func WithVAddr ¶
func WithVAddr(vaddr string) GatewayConfigOption
type GatewayServantActor ¶
type GatewayServantActor struct {
// contains filtered or unexported fields
}
func (*GatewayServantActor) Closed ¶
func (actor *GatewayServantActor) Closed(ctx context.Context)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.