Documentation
¶
Index ¶
Constants ¶
View Source
const ( // MetaWeight meta weight MetaWeight = "weight" // MetaOffline meta offline MetaOffline = "offline" // MetaAddrs meta public ip addrs MetaAddrs = "addrs" // MetaIPCount meta ip count MetaIPCount = "ip_count" // MetaConnCount meta conn count MetaConnCount = "conn_count" // PlatformWeb platform web PlatformWeb = "web" )
Variables ¶
This section is empty.
Functions ¶
func DecodeRoomKey ¶
DecodeRoomKey decode room key.
func EncodeRoomKey ¶
EncodeRoomKey encode a room key.
Types ¶
type Dao ¶
type Dao interface { PushMsg(c context.Context, op int32, server string, keys []string, msg []byte) (err error) BroadcastRoomMsg(c context.Context, op int32, room string, msg []byte) (err error) AddMapping(c context.Context, mid int64, key, server string) (err error) ExpireMapping(c context.Context, mid int64, key string) (has bool, err error) DelMapping(c context.Context, mid int64, key, server string) (has bool, err error) ServersByKeys(c context.Context, keys []string) (res []string, err error) KeysByMids(c context.Context, mids []int64) (ress map[string]string, olMids []int64, err error) AddServerOnline(c context.Context, server string, online *Online) (err error) ServerOnline(c context.Context, server string) (online *Online, err error) DelServerOnline(c context.Context, server string) (err error) Close() error }
type LogicProcess ¶
type LogicProcess interface { Connect(c context.Context, server, cookie string, token []byte) (mid int64, key, roomID string, accepts []int32, hb int64, err error) Disconnect(c context.Context, mid int64, key, server string) (has bool, err error) Heartbeat(c context.Context, mid int64, key, server string) (err error) RenewOnline(c context.Context, server string, roomCount map[string]int32) (map[string]int32, error) Receive(c context.Context, mid int64, proto *grpc.Proto) (err error) PushKeys(c context.Context, op int32, keys []string, msg []byte) (err error) PushMids(c context.Context, op int32, mids []int64, msg []byte) (err error) PushRoom(c context.Context, op int32, typ, room string, msg []byte) (err error) PushAll(c context.Context, op, speed int32, msg []byte) (err error) NodesInstances(c context.Context) (res []*naming.Instance) NodesWeighted(c context.Context, platform, clientIP string) *pb.NodesReply Ping(c context.Context) (err error) Close() OnlineTop(c context.Context, typ string, n int) (tops []*Top, err error) OnlineRoom(c context.Context, typ string, rooms []string) (res map[string]int32, err error) OnlineTotal(c context.Context) (int64, int64) }
Action interface for logic
Click to show internal directories.
Click to hide internal directories.