Documentation ¶
Index ¶
- type Dao
- func (d *Dao) AddMapping(c context.Context, mid int64, key, server string) (err error)
- func (d *Dao) AddServerScore(c context.Context, server string) (err error)
- func (d *Dao) BroadcastMsg(c context.Context, op, speed int32, platform string, msg []byte) (err error)
- func (d *Dao) BroadcastRoomMsg(c context.Context, op int32, room string, msg []byte) (err error)
- func (d *Dao) Close()
- func (d *Dao) DecrServerScore(c context.Context, server string) (err error)
- func (d *Dao) DelMapping(c context.Context, mid int64, key, server string) (has bool, err error)
- func (d *Dao) DelServerScore(c context.Context, server string) (err error)
- func (d *Dao) ExpireMapping(c context.Context, mid int64, key string) (has bool, err error)
- func (d *Dao) GetAllRoomCount(c context.Context) (allroomCount map[string]int32, err error)
- func (d *Dao) IncrServerScore(c context.Context, server string) (err error)
- func (d *Dao) KeysByMids(c context.Context, mids []int64) (ress map[string]string, olMids []int64, err error)
- func (d *Dao) Ping(c context.Context) error
- func (d *Dao) PushMsg(c context.Context, op int32, server string, keys []string, msg []byte) (err error)
- func (d *Dao) ServersByKeys(c context.Context, keys []string) (res []string, err error)
- func (d *Dao) ServersRank(c context.Context, num int64) (list []string, err error)
- func (d *Dao) UpdateRoomCount(c context.Context, server string, roomCount map[string]int32) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dao ¶
type Dao struct {
// contains filtered or unexported fields
}
Dao dao.
func (*Dao) AddMapping ¶
AddMapping add a mapping. Mapping: mid:用户ID key:设备ID mid -> key_server 一个用户可同时登录多个设备 key -> server 一个用户设备对应一个server
func (*Dao) AddServerScore ¶
add server info
func (*Dao) BroadcastMsg ¶
func (d *Dao) BroadcastMsg(c context.Context, op, speed int32, platform string, msg []byte) (err error)
BroadcastMsg push a message to databus.
func (*Dao) BroadcastRoomMsg ¶
BroadcastRoomMsg push a message to databus.
func (*Dao) DecrServerScore ¶
decr server score
func (*Dao) DelMapping ¶
DelMapping del a mapping.
func (*Dao) DelServerScore ¶
del server info
func (*Dao) ExpireMapping ¶
ExpireMapping expire a mapping.
func (*Dao) GetAllRoomCount ¶
func (*Dao) IncrServerScore ¶
incr server score
func (*Dao) KeysByMids ¶
func (d *Dao) KeysByMids(c context.Context, mids []int64) (ress map[string]string, olMids []int64, err error)
KeysByMids get a key server by mid.
func (*Dao) PushMsg ¶
func (d *Dao) PushMsg(c context.Context, op int32, server string, keys []string, msg []byte) (err error)
PushMsg push a message to databus.
func (*Dao) ServersByKeys ¶
ServersByKeys get a server by key.
func (*Dao) ServersRank ¶
get server list top
Click to show internal directories.
Click to hide internal directories.