Documentation ¶
Index ¶
- Variables
- type Logic
- func (logic *Logic) InitPublishRedisClient() (err error)
- func (logic *Logic) InitRPCServer() (err error)
- func (logic *Logic) RedisPublishChannel(serverID int, toUserID int, msg []byte) (err error)
- func (logic *Logic) RedisPublishRoomInfo(roomID int, count int, RoomUserInfo map[string]string, msg []byte) (err error)
- func (logic *Logic) RedisPushRoomCount(roomID int, count int) (err error)
- func (logic *Logic) RedisPushRoomInfo(roomID int, count int, roomUserInfo map[string]string) (err error)
- func (logic *Logic) Run()
- type RPCLogic
- func (rpc *RPCLogic) CheckAuth(ctx context.Context, args *proto.CheckAuthRequest, ...) (err error)
- func (rpc *RPCLogic) Connect(ctx context.Context, args *proto.ConnectRequest, reply *proto.ConnectReply) (err error)
- func (rpc *RPCLogic) Count(ctx context.Context, args *proto.Send, reply *proto.SuccessReply) (err error)
- func (rpc *RPCLogic) DisConnect(ctx context.Context, args *proto.DisConnectRequest, ...) (err error)
- func (rpc *RPCLogic) GetRoomInfo(ctx context.Context, args *proto.Send, reply *proto.SuccessReply) (err error)
- func (rpc *RPCLogic) GetUserInfoByUserID(ctx context.Context, args *proto.GetUserInfoRequest, ...) (err error)
- func (rpc *RPCLogic) Login(ctx context.Context, args *proto.RegisterRequest, reply *proto.RegisterReply) (err error)
- func (rpc *RPCLogic) Logout(ctx context.Context, args *proto.LogoutRequest, reply *proto.LogoutResponse) (err error)
- func (rpc *RPCLogic) Push(ctx context.Context, args *proto.Send, reply *proto.SuccessReply) (err error)
- func (rpc *RPCLogic) PushRoom(ctx context.Context, args *proto.Send, reply *proto.SuccessReply) (err error)
- func (rpc *RPCLogic) Register(ctx context.Context, req *proto.RegisterRequest, reply *proto.RegisterReply) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // RedisClient ... RedisClient *redis.Client // RedisSessClient ... RedisSessClient *redis.Client )
Functions ¶
This section is empty.
Types ¶
type Logic ¶
type Logic struct { }
Logic ...
func (*Logic) InitPublishRedisClient ¶
InitPublishRedisClient ...
func (*Logic) RedisPublishChannel ¶
RedisPublishChannel 发布消息
func (*Logic) RedisPublishRoomInfo ¶
func (logic *Logic) RedisPublishRoomInfo(roomID int, count int, RoomUserInfo map[string]string, msg []byte) (err error)
RedisPublishRoomInfo 发布一个房间的信息
func (*Logic) RedisPushRoomCount ¶
RedisPushRoomCount 发布一个房间里面的所有用户数
type RPCLogic ¶
type RPCLogic struct { }
RPCLogic ...
func (*RPCLogic) CheckAuth ¶
func (rpc *RPCLogic) CheckAuth(ctx context.Context, args *proto.CheckAuthRequest, reply *proto.CheckAuthResponse) (err error)
CheckAuth ...
func (*RPCLogic) Connect ¶
func (rpc *RPCLogic) Connect(ctx context.Context, args *proto.ConnectRequest, reply *proto.ConnectReply) (err error)
Connect handle connect request
func (*RPCLogic) Count ¶
func (rpc *RPCLogic) Count(ctx context.Context, args *proto.Send, reply *proto.SuccessReply) (err error)
Count get room online person count
func (*RPCLogic) DisConnect ¶
func (rpc *RPCLogic) DisConnect(ctx context.Context, args *proto.DisConnectRequest, reply *proto.DisConnectReply) (err error)
DisConnect ...
func (*RPCLogic) GetRoomInfo ¶
func (rpc *RPCLogic) GetRoomInfo(ctx context.Context, args *proto.Send, reply *proto.SuccessReply) (err error)
GetRoomInfo get room info
func (*RPCLogic) GetUserInfoByUserID ¶
func (rpc *RPCLogic) GetUserInfoByUserID(ctx context.Context, args *proto.GetUserInfoRequest, reply *proto.GetUserInfoResponse) (err error)
GetUserInfoByUserID ...
func (*RPCLogic) Login ¶
func (rpc *RPCLogic) Login(ctx context.Context, args *proto.RegisterRequest, reply *proto.RegisterReply) (err error)
Login ...
func (*RPCLogic) Logout ¶
func (rpc *RPCLogic) Logout(ctx context.Context, args *proto.LogoutRequest, reply *proto.LogoutResponse) (err error)
Logout ...
func (*RPCLogic) Push ¶
func (rpc *RPCLogic) Push(ctx context.Context, args *proto.Send, reply *proto.SuccessReply) (err error)
Push single send msg
func (*RPCLogic) PushRoom ¶
func (rpc *RPCLogic) PushRoom(ctx context.Context, args *proto.Send, reply *proto.SuccessReply) (err error)
PushRoom push msg to room
func (*RPCLogic) Register ¶
func (rpc *RPCLogic) Register(ctx context.Context, req *proto.RegisterRequest, reply *proto.RegisterReply) (err error)
Register ...
Click to show internal directories.
Click to hide internal directories.