Documentation ¶
Index ¶
- type LoadBalancer
- type Logic
- func (l *Logic) Close()
- func (l *Logic) Connect(c context.Context, server, cookie string, token []byte) (mid int64, key, roomID string, accepts []int32, hb int64, err error)
- func (l *Logic) Disconnect(c context.Context, mid int64, key, server string) (has bool, err error)
- func (l *Logic) Heartbeat(c context.Context, mid int64, key, server string) (err error)
- func (l *Logic) NodesInstances(c context.Context) (res []*naming.Instance)
- func (l *Logic) NodesWeighted(c context.Context, platform, clientIP string) *pb.NodesReply
- func (l *Logic) OnlineRoom(c context.Context, typ string, rooms []string) (res map[string]int32, err error)
- func (l *Logic) OnlineTop(c context.Context, typ string, n int) (tops []*model.Top, err error)
- func (l *Logic) OnlineTotal(c context.Context) (int64, int64)
- func (l *Logic) Ping(c context.Context) (err error)
- func (l *Logic) PushAll(c context.Context, op, speed int32, msg []byte) (err error)
- func (l *Logic) PushKeys(c context.Context, op int32, keys []string, msg []byte) (err error)
- func (l *Logic) PushMids(c context.Context, op int32, mids []int64, msg []byte) (err error)
- func (l *Logic) PushRoom(c context.Context, op int32, typ, room string, msg []byte) (err error)
- func (l *Logic) Receive(c context.Context, mid int64, proto *protocol.Proto) (err error)
- func (l *Logic) RenewOnline(c context.Context, server string, roomCount map[string]int32) (map[string]int32, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LoadBalancer ¶
type LoadBalancer struct {
// contains filtered or unexported fields
}
LoadBalancer load balancer.
func (*LoadBalancer) NodeAddrs ¶
func (lb *LoadBalancer) NodeAddrs(region, domain string, regionWeight float64) (domains, addrs []string)
NodeAddrs return node addrs.
func (*LoadBalancer) Update ¶
func (lb *LoadBalancer) Update(ins []*naming.Instance)
Update update server nodes.
type Logic ¶
type Logic struct {
// contains filtered or unexported fields
}
Logic struct
func (*Logic) Connect ¶
func (l *Logic) Connect(c context.Context, server, cookie string, token []byte) (mid int64, key, roomID string, accepts []int32, hb int64, err error)
Connect connected a conn.
func (*Logic) Disconnect ¶
Disconnect disconnect a conn.
func (*Logic) NodesInstances ¶
NodesInstances get servers info.
func (*Logic) NodesWeighted ¶
NodesWeighted get node list.
func (*Logic) OnlineRoom ¶
func (l *Logic) OnlineRoom(c context.Context, typ string, rooms []string) (res map[string]int32, err error)
OnlineRoom get rooms online.
func (*Logic) OnlineTotal ¶
OnlineTotal get all online.
Click to show internal directories.
Click to hide internal directories.