Documentation ¶
Index ¶
- Constants
- func EmailSend(to []string, title string, context string, from string) error
- func GenEmailCode(digit int) string
- type Account
- func (a *Account) Alias() string
- func (a *Account) ComparePwd(reqPwd string, hashPwd string) bool
- func (a *Account) EmailCode(ctx *protocol.Context, req *EmailCodeReq, rsp *ApiRsp, tag struct{}) *gnetrpc.CallMode
- func (a *Account) HashPwd(pwd string) string
- func (a *Account) Init(v ...interface{}) gnetrpc.IService
- func (a *Account) Login(ctx *protocol.Context, req *LoginReq, rsp *ApiRsp, tag struct{}) *gnetrpc.CallMode
- func (a *Account) Logout(ctx *protocol.Context, req *struct{}, rsp *ApiRsp, tag struct{}) *gnetrpc.CallMode
- func (a *Account) Register(ctx *protocol.Context, req *RegisterReq, rsp *ApiRsp, tag struct{}) *gnetrpc.CallMode
- type ApiRsp
- type ClosePlugin
- type CreateRoomReq
- type CreateRoomRsp
- type EmailCodeReq
- type GameMgr
- type LoginReq
- type LoginRsp
- type RegisterReq
- type Room
- type RoomInfosRsp
- type RoomMgr
- func (r *RoomMgr) AddRoom(room *Room)
- func (r *RoomMgr) Alias() string
- func (r *RoomMgr) Chat(ctx *protocol.Context, txt *string, rsp *ApiRsp) *gnetrpc.CallMode
- func (r *RoomMgr) ConnOnClose(conn gnet.Conn) error
- func (r *RoomMgr) Create(ctx *protocol.Context, req *CreateRoomReq, rsp *ApiRsp) *gnetrpc.CallMode
- func (r *RoomMgr) DelRoom(id string)
- func (r *RoomMgr) GetRoom(id string) (*Room, bool)
- func (r *RoomMgr) Init(v ...interface{}) gnetrpc.IService
- func (r *RoomMgr) Join(ctx *protocol.Context, id *string, rsp *ApiRsp) *gnetrpc.CallMode
- func (r *RoomMgr) Leave(ctx *protocol.Context, req *struct{}, rsp *ApiRsp) *gnetrpc.CallMode
- func (r *RoomMgr) RoomsInfo(ctx *protocol.Context, req *struct{}, rsp *ApiRsp) *gnetrpc.CallMode
- func (r *RoomMgr) StartGame(ctx *protocol.Context, id *string, rsp *ApiRsp) *gnetrpc.CallMode
- type ShutdownPlugin
Constants ¶
View Source
const ( CodeTimeOut = 3 * time.Minute GenSignUpCode = "GenSignUpCode" Login = "" )
View Source
const ( OkCode = 200 ErrCode = -1 )
View Source
const ( RoomIdKey = "_RoomId" UserInfoKey = "_UserInfo" )
Variables ¶
This section is empty.
Functions ¶
func GenEmailCode ¶
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
func (*Account) Login ¶
func (a *Account) Login(ctx *protocol.Context, req *LoginReq, rsp *ApiRsp, tag struct{}) *gnetrpc.CallMode
{"Email":"1273014435@qq.com","Pwd":"123"}
type ApiRsp ¶
type ClosePlugin ¶
type ClosePlugin struct { }
func (*ClosePlugin) Init ¶
func (c *ClosePlugin) Init(args ...interface{}) gnetrpc.Plugin
func (*ClosePlugin) OnDo ¶
func (c *ClosePlugin) OnDo(args ...interface{}) error
func (*ClosePlugin) Type ¶
func (c *ClosePlugin) Type() gnetrpc.PluginType
type CreateRoomReq ¶
type CreateRoomRsp ¶
type CreateRoomRsp struct {
Id string `json:"id"`
}
type EmailCodeReq ¶
type EmailCodeReq struct {
Email string `json:"email"`
}
type RegisterReq ¶
type RoomInfosRsp ¶
type RoomMgr ¶
type RoomMgr struct {
// contains filtered or unexported fields
}
func (*RoomMgr) ConnOnClose ¶
type ShutdownPlugin ¶
type ShutdownPlugin struct { }
func (*ShutdownPlugin) Init ¶
func (s *ShutdownPlugin) Init(args ...interface{}) gnetrpc.Plugin
func (*ShutdownPlugin) OnDo ¶
func (s *ShutdownPlugin) OnDo(args ...interface{}) error
func (*ShutdownPlugin) Type ¶
func (s *ShutdownPlugin) Type() gnetrpc.PluginType
Click to show internal directories.
Click to hide internal directories.