Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterChatServiceServer(s grpc.ServiceRegistrar, srv ChatServiceServer)
- func RegisterGameServiceServer(s grpc.ServiceRegistrar, srv GameServiceServer)
- func RegisterMatchServiceServer(s grpc.ServiceRegistrar, srv MatchServiceServer)
- func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)
- type ChatServiceClient
- type ChatServiceServer
- type CreateRoomRequest
- func (*CreateRoomRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateRoomRequest) GetPlayer1Email() string
- func (x *CreateRoomRequest) GetPlayer2Email() string
- func (*CreateRoomRequest) ProtoMessage()
- func (x *CreateRoomRequest) ProtoReflect() protoreflect.Message
- func (x *CreateRoomRequest) Reset()
- func (x *CreateRoomRequest) String() string
- type CreateRoomResponse
- func (*CreateRoomResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CreateRoomResponse) GetBlackPlayerEmail() string
- func (x *CreateRoomResponse) GetError() string
- func (x *CreateRoomResponse) GetRoomId() string
- func (x *CreateRoomResponse) GetWhitePlayerEmail() string
- func (*CreateRoomResponse) ProtoMessage()
- func (x *CreateRoomResponse) ProtoReflect() protoreflect.Message
- func (x *CreateRoomResponse) Reset()
- func (x *CreateRoomResponse) String() string
- type GameOverMessage
- func (*GameOverMessage) Descriptor() ([]byte, []int)deprecated
- func (x *GameOverMessage) GetBlackPlayer() *Player
- func (x *GameOverMessage) GetGameStatus() GameStatus
- func (x *GameOverMessage) GetRoomId() string
- func (x *GameOverMessage) GetWhitePlayer() *Player
- func (*GameOverMessage) ProtoMessage()
- func (x *GameOverMessage) ProtoReflect() protoreflect.Message
- func (x *GameOverMessage) Reset()
- func (x *GameOverMessage) String() string
- type GameRoom
- func (*GameRoom) Descriptor() ([]byte, []int)deprecated
- func (x *GameRoom) GetBlackPlayer() *Player
- func (x *GameRoom) GetGobang() *Gobang
- func (x *GameRoom) GetRoomId() string
- func (x *GameRoom) GetWhitePlayer() *Player
- func (*GameRoom) ProtoMessage()
- func (x *GameRoom) ProtoReflect() protoreflect.Message
- func (x *GameRoom) Reset()
- func (x *GameRoom) String() string
- type GameServiceClient
- type GameServiceServer
- type GameStatus
- type GetGameRoomByEmailRequest
- func (*GetGameRoomByEmailRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetGameRoomByEmailRequest) GetEmail() string
- func (*GetGameRoomByEmailRequest) ProtoMessage()
- func (x *GetGameRoomByEmailRequest) ProtoReflect() protoreflect.Message
- func (x *GetGameRoomByEmailRequest) Reset()
- func (x *GetGameRoomByEmailRequest) String() string
- type GetGameRoomByEmailResponse
- func (*GetGameRoomByEmailResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetGameRoomByEmailResponse) GetError() string
- func (x *GetGameRoomByEmailResponse) GetGameRoom() *GameRoom
- func (*GetGameRoomByEmailResponse) ProtoMessage()
- func (x *GetGameRoomByEmailResponse) ProtoReflect() protoreflect.Message
- func (x *GetGameRoomByEmailResponse) Reset()
- func (x *GetGameRoomByEmailResponse) String() string
- type GetMessageListRequest
- func (*GetMessageListRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetMessageListRequest) GetRoomId() string
- func (*GetMessageListRequest) ProtoMessage()
- func (x *GetMessageListRequest) ProtoReflect() protoreflect.Message
- func (x *GetMessageListRequest) Reset()
- func (x *GetMessageListRequest) String() string
- type GetMessageListResponse
- func (*GetMessageListResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetMessageListResponse) GetMessages() *MessageList
- func (*GetMessageListResponse) ProtoMessage()
- func (x *GetMessageListResponse) ProtoReflect() protoreflect.Message
- func (x *GetMessageListResponse) Reset()
- func (x *GetMessageListResponse) String() string
- type GetUserInfoRequest
- func (*GetUserInfoRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetUserInfoRequest) GetEmail() string
- func (*GetUserInfoRequest) ProtoMessage()
- func (x *GetUserInfoRequest) ProtoReflect() protoreflect.Message
- func (x *GetUserInfoRequest) Reset()
- func (x *GetUserInfoRequest) String() string
- type GetUserInfoResponse
- func (*GetUserInfoResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetUserInfoResponse) GetError() string
- func (x *GetUserInfoResponse) GetUser() *User
- func (*GetUserInfoResponse) ProtoMessage()
- func (x *GetUserInfoResponse) ProtoReflect() protoreflect.Message
- func (x *GetUserInfoResponse) Reset()
- func (x *GetUserInfoResponse) String() string
- type Gobang
- func (*Gobang) Descriptor() ([]byte, []int)deprecated
- func (x *Gobang) GetBoardSize() int32
- func (x *Gobang) GetCompressedBoard() []byte
- func (x *Gobang) GetCurrentColor() GobangColor
- func (x *Gobang) GetStatus() GameStatus
- func (*Gobang) ProtoMessage()
- func (x *Gobang) ProtoReflect() protoreflect.Message
- func (x *Gobang) Reset()
- func (x *Gobang) String() string
- type GobangCell
- type GobangColor
- func (GobangColor) Descriptor() protoreflect.EnumDescriptor
- func (x GobangColor) Enum() *GobangColor
- func (GobangColor) EnumDescriptor() ([]byte, []int)deprecated
- func (x GobangColor) Number() protoreflect.EnumNumber
- func (x GobangColor) String() string
- func (GobangColor) Type() protoreflect.EnumType
- type GobangResult
- func (GobangResult) Descriptor() protoreflect.EnumDescriptor
- func (x GobangResult) Enum() *GobangResult
- func (GobangResult) EnumDescriptor() ([]byte, []int)deprecated
- func (x GobangResult) Number() protoreflect.EnumNumber
- func (x GobangResult) String() string
- func (GobangResult) Type() protoreflect.EnumType
- type JoinQueueResult
- func (JoinQueueResult) Descriptor() protoreflect.EnumDescriptor
- func (x JoinQueueResult) Enum() *JoinQueueResult
- func (JoinQueueResult) EnumDescriptor() ([]byte, []int)deprecated
- func (x JoinQueueResult) Number() protoreflect.EnumNumber
- func (x JoinQueueResult) String() string
- func (JoinQueueResult) Type() protoreflect.EnumType
- type JoinRequest
- type JoinResponse
- type LoginRequest
- func (*LoginRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LoginRequest) GetEmail() string
- func (x *LoginRequest) GetPassword() string
- func (*LoginRequest) ProtoMessage()
- func (x *LoginRequest) ProtoReflect() protoreflect.Message
- func (x *LoginRequest) Reset()
- func (x *LoginRequest) String() string
- type LoginResponse
- func (*LoginResponse) Descriptor() ([]byte, []int)deprecated
- func (x *LoginResponse) GetEmail() string
- func (x *LoginResponse) GetError() string
- func (*LoginResponse) ProtoMessage()
- func (x *LoginResponse) ProtoReflect() protoreflect.Message
- func (x *LoginResponse) Reset()
- func (x *LoginResponse) String() string
- type MatchBroacastMessage
- func (*MatchBroacastMessage) Descriptor() ([]byte, []int)deprecated
- func (x *MatchBroacastMessage) GetBlackPlayerEmail() string
- func (x *MatchBroacastMessage) GetRoomId() string
- func (x *MatchBroacastMessage) GetWhitePlayerEmail() string
- func (*MatchBroacastMessage) ProtoMessage()
- func (x *MatchBroacastMessage) ProtoReflect() protoreflect.Message
- func (x *MatchBroacastMessage) Reset()
- func (x *MatchBroacastMessage) String() string
- type MatchServiceClient
- type MatchServiceServer
- type Message
- func (*Message) Descriptor() ([]byte, []int)deprecated
- func (x *Message) GetContent() string
- func (x *Message) GetRoomId() string
- func (x *Message) GetSenderEmail() string
- func (*Message) ProtoMessage()
- func (x *Message) ProtoReflect() protoreflect.Message
- func (x *Message) Reset()
- func (x *Message) String() string
- type MessageList
- type MoveBroadcastMessage
- func (*MoveBroadcastMessage) Descriptor() ([]byte, []int)deprecated
- func (x *MoveBroadcastMessage) GetFrom() *Player
- func (x *MoveBroadcastMessage) GetRoomId() string
- func (x *MoveBroadcastMessage) GetTo() *Player
- func (x *MoveBroadcastMessage) GetX() int32
- func (x *MoveBroadcastMessage) GetY() int32
- func (*MoveBroadcastMessage) ProtoMessage()
- func (x *MoveBroadcastMessage) ProtoReflect() protoreflect.Message
- func (x *MoveBroadcastMessage) Reset()
- func (x *MoveBroadcastMessage) String() string
- type MoveRequest
- func (*MoveRequest) Descriptor() ([]byte, []int)deprecated
- func (x *MoveRequest) GetPlayerEmail() string
- func (x *MoveRequest) GetRoomId() string
- func (x *MoveRequest) GetX() int32
- func (x *MoveRequest) GetY() int32
- func (*MoveRequest) ProtoMessage()
- func (x *MoveRequest) ProtoReflect() protoreflect.Message
- func (x *MoveRequest) Reset()
- func (x *MoveRequest) String() string
- type MoveResponse
- type Player
- func (*Player) Descriptor() ([]byte, []int)deprecated
- func (x *Player) GetColor() GobangColor
- func (x *Player) GetEmail() string
- func (x *Player) GetRoomId() string
- func (*Player) ProtoMessage()
- func (x *Player) ProtoReflect() protoreflect.Message
- func (x *Player) Reset()
- func (x *Player) String() string
- type RegisterRequest
- func (*RegisterRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RegisterRequest) GetEmail() string
- func (x *RegisterRequest) GetPassword() string
- func (x *RegisterRequest) GetUsername() string
- func (*RegisterRequest) ProtoMessage()
- func (x *RegisterRequest) ProtoReflect() protoreflect.Message
- func (x *RegisterRequest) Reset()
- func (x *RegisterRequest) String() string
- type RegisterResponse
- type SendMessageRequest
- func (*SendMessageRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SendMessageRequest) GetMessage() *Message
- func (*SendMessageRequest) ProtoMessage()
- func (x *SendMessageRequest) ProtoReflect() protoreflect.Message
- func (x *SendMessageRequest) Reset()
- func (x *SendMessageRequest) String() string
- type SendMessageResponse
- func (*SendMessageResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SendMessageResponse) GetSuccess() bool
- func (*SendMessageResponse) ProtoMessage()
- func (x *SendMessageResponse) ProtoReflect() protoreflect.Message
- func (x *SendMessageResponse) Reset()
- func (x *SendMessageResponse) String() string
- type SetUserStatusRequest
- func (*SetUserStatusRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SetUserStatusRequest) GetEmail() string
- func (x *SetUserStatusRequest) GetStatus() UserStatus
- func (*SetUserStatusRequest) ProtoMessage()
- func (x *SetUserStatusRequest) ProtoReflect() protoreflect.Message
- func (x *SetUserStatusRequest) Reset()
- func (x *SetUserStatusRequest) String() string
- type SetUserStatusResponse
- func (*SetUserStatusResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SetUserStatusResponse) GetError() string
- func (*SetUserStatusResponse) ProtoMessage()
- func (x *SetUserStatusResponse) ProtoReflect() protoreflect.Message
- func (x *SetUserStatusResponse) Reset()
- func (x *SetUserStatusResponse) String() string
- type UnimplementedChatServiceServer
- type UnimplementedGameServiceServer
- func (UnimplementedGameServiceServer) CreateRoom(context.Context, *CreateRoomRequest) (*CreateRoomResponse, error)
- func (UnimplementedGameServiceServer) GetGameRoomByEmail(context.Context, *GetGameRoomByEmailRequest) (*GetGameRoomByEmailResponse, error)
- func (UnimplementedGameServiceServer) MakeMove(context.Context, *MoveRequest) (*MoveResponse, error)
- type UnimplementedMatchServiceServer
- type UnimplementedUserServiceServer
- func (UnimplementedUserServiceServer) GetUserInfo(context.Context, *GetUserInfoRequest) (*GetUserInfoResponse, error)
- func (UnimplementedUserServiceServer) Login(context.Context, *LoginRequest) (*LoginResponse, error)
- func (UnimplementedUserServiceServer) Register(context.Context, *RegisterRequest) (*RegisterResponse, error)
- func (UnimplementedUserServiceServer) SetUserStatus(context.Context, *SetUserStatusRequest) (*SetUserStatusResponse, error)
- type UnsafeChatServiceServer
- type UnsafeGameServiceServer
- type UnsafeMatchServiceServer
- type UnsafeUserServiceServer
- type User
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) GetElo() int32
- func (x *User) GetEmail() string
- func (x *User) GetId() string
- func (x *User) GetStatus() UserStatus
- func (x *User) GetUsername() string
- func (*User) ProtoMessage()
- func (x *User) ProtoReflect() protoreflect.Message
- func (x *User) Reset()
- func (x *User) String() string
- type UserServiceClient
- type UserServiceServer
- type UserStatus
Constants ¶
const ( ChatService_SendMessage_FullMethodName = "/chat.ChatService/SendMessage" ChatService_GetMessageList_FullMethodName = "/chat.ChatService/GetMessageList" )
const ( GameService_CreateRoom_FullMethodName = "/gobang.GameService/CreateRoom" GameService_MakeMove_FullMethodName = "/gobang.GameService/MakeMove" GameService_GetGameRoomByEmail_FullMethodName = "/gobang.GameService/GetGameRoomByEmail" )
const ( UserService_Login_FullMethodName = "/user.UserService/Login" UserService_Register_FullMethodName = "/user.UserService/Register" UserService_GetUserInfo_FullMethodName = "/user.UserService/GetUserInfo" UserService_SetUserStatus_FullMethodName = "/user.UserService/SetUserStatus" )
const (
MatchService_JoinQueue_FullMethodName = "/match.MatchService/JoinQueue"
)
Variables ¶
var ( GobangResult_name = map[int32]string{ 0: "Success", 1: "InvalidMove", 2: "GameOver", 3: "RoomNotFound", 4: "PlayerNotInRoom", 5: "NotYourTurn", 6: "ServerError", } GobangResult_value = map[string]int32{ "Success": 0, "InvalidMove": 1, "GameOver": 2, "RoomNotFound": 3, "PlayerNotInRoom": 4, "NotYourTurn": 5, "ServerError": 6, } )
Enum value maps for GobangResult.
var ( GobangColor_name = map[int32]string{ 0: "White", 1: "Black", } GobangColor_value = map[string]int32{ "White": 0, "Black": 1, } )
Enum value maps for GobangColor.
var ( GobangCell_name = map[int32]string{ 0: "EmptyCell", 1: "WhiteCell", 2: "BlackCell", } GobangCell_value = map[string]int32{ "EmptyCell": 0, "WhiteCell": 1, "BlackCell": 2, } )
Enum value maps for GobangCell.
var ( GameStatus_name = map[int32]string{ 0: "Playing", 1: "WhiteWin", 2: "BlackWin", 3: "Draw", } GameStatus_value = map[string]int32{ "Playing": 0, "WhiteWin": 1, "BlackWin": 2, "Draw": 3, } )
Enum value maps for GameStatus.
var ( JoinQueueResult_name = map[int32]string{ 0: "Success", 1: "PlayerAlreadyInQueue", 2: "PlayerAlreadyInGame", } JoinQueueResult_value = map[string]int32{ "Success": 0, "PlayerAlreadyInQueue": 1, "PlayerAlreadyInGame": 2, } )
Enum value maps for JoinQueueResult.
var ( UserStatus_name = map[int32]string{ 0: "Online", 1: "Offline", 2: "InGame", 3: "Matching", } UserStatus_value = map[string]int32{ "Online": 0, "Offline": 1, "InGame": 2, "Matching": 3, } )
Enum value maps for UserStatus.
var ChatService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "chat.ChatService", HandlerType: (*ChatServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SendMessage", Handler: _ChatService_SendMessage_Handler, }, { MethodName: "GetMessageList", Handler: _ChatService_GetMessageList_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "chat.proto", }
ChatService_ServiceDesc is the grpc.ServiceDesc for ChatService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_chat_proto protoreflect.FileDescriptor
var File_gobang_proto protoreflect.FileDescriptor
var File_match_proto protoreflect.FileDescriptor
var File_user_proto protoreflect.FileDescriptor
var GameService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "gobang.GameService", HandlerType: (*GameServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateRoom", Handler: _GameService_CreateRoom_Handler, }, { MethodName: "MakeMove", Handler: _GameService_MakeMove_Handler, }, { MethodName: "GetGameRoomByEmail", Handler: _GameService_GetGameRoomByEmail_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "gobang.proto", }
GameService_ServiceDesc is the grpc.ServiceDesc for GameService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var MatchService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "match.MatchService", HandlerType: (*MatchServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "JoinQueue", Handler: _MatchService_JoinQueue_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "match.proto", }
MatchService_ServiceDesc is the grpc.ServiceDesc for MatchService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var UserService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "user.UserService", HandlerType: (*UserServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Login", Handler: _UserService_Login_Handler, }, { MethodName: "Register", Handler: _UserService_Register_Handler, }, { MethodName: "GetUserInfo", Handler: _UserService_GetUserInfo_Handler, }, { MethodName: "SetUserStatus", Handler: _UserService_SetUserStatus_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "user.proto", }
UserService_ServiceDesc is the grpc.ServiceDesc for UserService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterChatServiceServer ¶
func RegisterChatServiceServer(s grpc.ServiceRegistrar, srv ChatServiceServer)
func RegisterGameServiceServer ¶
func RegisterGameServiceServer(s grpc.ServiceRegistrar, srv GameServiceServer)
func RegisterMatchServiceServer ¶
func RegisterMatchServiceServer(s grpc.ServiceRegistrar, srv MatchServiceServer)
func RegisterUserServiceServer ¶
func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)
Types ¶
type ChatServiceClient ¶
type ChatServiceClient interface { // 发送消息 SendMessage(ctx context.Context, in *SendMessageRequest, opts ...grpc.CallOption) (*SendMessageResponse, error) // 获取消息列表 GetMessageList(ctx context.Context, in *GetMessageListRequest, opts ...grpc.CallOption) (*GetMessageListResponse, error) }
ChatServiceClient is the client API for ChatService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
聊天服务
func NewChatServiceClient ¶
func NewChatServiceClient(cc grpc.ClientConnInterface) ChatServiceClient
type ChatServiceServer ¶
type ChatServiceServer interface { // 发送消息 SendMessage(context.Context, *SendMessageRequest) (*SendMessageResponse, error) // 获取消息列表 GetMessageList(context.Context, *GetMessageListRequest) (*GetMessageListResponse, error) // contains filtered or unexported methods }
ChatServiceServer is the server API for ChatService service. All implementations must embed UnimplementedChatServiceServer for forward compatibility.
聊天服务
type CreateRoomRequest ¶
type CreateRoomRequest struct { Player1Email string `protobuf:"bytes,1,opt,name=player1_email,json=player1Email,proto3" json:"player1_email,omitempty"` Player2Email string `protobuf:"bytes,2,opt,name=player2_email,json=player2Email,proto3" json:"player2_email,omitempty"` // contains filtered or unexported fields }
创建房间请求
func (*CreateRoomRequest) Descriptor
deprecated
func (*CreateRoomRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateRoomRequest.ProtoReflect.Descriptor instead.
func (*CreateRoomRequest) GetPlayer1Email ¶
func (x *CreateRoomRequest) GetPlayer1Email() string
func (*CreateRoomRequest) GetPlayer2Email ¶
func (x *CreateRoomRequest) GetPlayer2Email() string
func (*CreateRoomRequest) ProtoMessage ¶
func (*CreateRoomRequest) ProtoMessage()
func (*CreateRoomRequest) ProtoReflect ¶
func (x *CreateRoomRequest) ProtoReflect() protoreflect.Message
func (*CreateRoomRequest) Reset ¶
func (x *CreateRoomRequest) Reset()
func (*CreateRoomRequest) String ¶
func (x *CreateRoomRequest) String() string
type CreateRoomResponse ¶
type CreateRoomResponse struct { RoomId string `protobuf:"bytes,1,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"` Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` // 白棋玩家邮箱 WhitePlayerEmail string `protobuf:"bytes,3,opt,name=white_player_email,json=whitePlayerEmail,proto3" json:"white_player_email,omitempty"` // 黑棋玩家邮箱 BlackPlayerEmail string `protobuf:"bytes,4,opt,name=black_player_email,json=blackPlayerEmail,proto3" json:"black_player_email,omitempty"` // contains filtered or unexported fields }
创建房间响应
func (*CreateRoomResponse) Descriptor
deprecated
func (*CreateRoomResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreateRoomResponse.ProtoReflect.Descriptor instead.
func (*CreateRoomResponse) GetBlackPlayerEmail ¶
func (x *CreateRoomResponse) GetBlackPlayerEmail() string
func (*CreateRoomResponse) GetError ¶
func (x *CreateRoomResponse) GetError() string
func (*CreateRoomResponse) GetRoomId ¶
func (x *CreateRoomResponse) GetRoomId() string
func (*CreateRoomResponse) GetWhitePlayerEmail ¶
func (x *CreateRoomResponse) GetWhitePlayerEmail() string
func (*CreateRoomResponse) ProtoMessage ¶
func (*CreateRoomResponse) ProtoMessage()
func (*CreateRoomResponse) ProtoReflect ¶
func (x *CreateRoomResponse) ProtoReflect() protoreflect.Message
func (*CreateRoomResponse) Reset ¶
func (x *CreateRoomResponse) Reset()
func (*CreateRoomResponse) String ¶
func (x *CreateRoomResponse) String() string
type GameOverMessage ¶ added in v0.1.3
type GameOverMessage struct { RoomId string `protobuf:"bytes,1,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"` GameStatus GameStatus `protobuf:"varint,2,opt,name=game_status,json=gameStatus,proto3,enum=gobang.GameStatus" json:"game_status,omitempty"` WhitePlayer *Player `protobuf:"bytes,3,opt,name=white_player,json=whitePlayer,proto3" json:"white_player,omitempty"` BlackPlayer *Player `protobuf:"bytes,4,opt,name=black_player,json=blackPlayer,proto3" json:"black_player,omitempty"` // contains filtered or unexported fields }
游戏结束消息
func (*GameOverMessage) Descriptor
deprecated
added in
v0.1.3
func (*GameOverMessage) Descriptor() ([]byte, []int)
Deprecated: Use GameOverMessage.ProtoReflect.Descriptor instead.
func (*GameOverMessage) GetBlackPlayer ¶ added in v0.1.4
func (x *GameOverMessage) GetBlackPlayer() *Player
func (*GameOverMessage) GetGameStatus ¶ added in v0.1.3
func (x *GameOverMessage) GetGameStatus() GameStatus
func (*GameOverMessage) GetRoomId ¶ added in v0.1.3
func (x *GameOverMessage) GetRoomId() string
func (*GameOverMessage) GetWhitePlayer ¶ added in v0.1.4
func (x *GameOverMessage) GetWhitePlayer() *Player
func (*GameOverMessage) ProtoMessage ¶ added in v0.1.3
func (*GameOverMessage) ProtoMessage()
func (*GameOverMessage) ProtoReflect ¶ added in v0.1.3
func (x *GameOverMessage) ProtoReflect() protoreflect.Message
func (*GameOverMessage) Reset ¶ added in v0.1.3
func (x *GameOverMessage) Reset()
func (*GameOverMessage) String ¶ added in v0.1.3
func (x *GameOverMessage) String() string
type GameRoom ¶
type GameRoom struct { RoomId string `protobuf:"bytes,1,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"` WhitePlayer *Player `protobuf:"bytes,2,opt,name=white_player,json=whitePlayer,proto3" json:"white_player,omitempty"` BlackPlayer *Player `protobuf:"bytes,3,opt,name=black_player,json=blackPlayer,proto3" json:"black_player,omitempty"` Gobang *Gobang `protobuf:"bytes,4,opt,name=gobang,proto3" json:"gobang,omitempty"` // contains filtered or unexported fields }
游戏房间
func (*GameRoom) Descriptor
deprecated
func (*GameRoom) GetBlackPlayer ¶
func (*GameRoom) GetWhitePlayer ¶
func (*GameRoom) ProtoMessage ¶
func (*GameRoom) ProtoMessage()
func (*GameRoom) ProtoReflect ¶
func (x *GameRoom) ProtoReflect() protoreflect.Message
type GameServiceClient ¶
type GameServiceClient interface { CreateRoom(ctx context.Context, in *CreateRoomRequest, opts ...grpc.CallOption) (*CreateRoomResponse, error) MakeMove(ctx context.Context, in *MoveRequest, opts ...grpc.CallOption) (*MoveResponse, error) GetGameRoomByEmail(ctx context.Context, in *GetGameRoomByEmailRequest, opts ...grpc.CallOption) (*GetGameRoomByEmailResponse, error) }
GameServiceClient is the client API for GameService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
游戏服务
func NewGameServiceClient ¶
func NewGameServiceClient(cc grpc.ClientConnInterface) GameServiceClient
type GameServiceServer ¶
type GameServiceServer interface { CreateRoom(context.Context, *CreateRoomRequest) (*CreateRoomResponse, error) MakeMove(context.Context, *MoveRequest) (*MoveResponse, error) GetGameRoomByEmail(context.Context, *GetGameRoomByEmailRequest) (*GetGameRoomByEmailResponse, error) // contains filtered or unexported methods }
GameServiceServer is the server API for GameService service. All implementations must embed UnimplementedGameServiceServer for forward compatibility.
游戏服务
type GameStatus ¶
type GameStatus int32
游戏状态
const ( GameStatus_Playing GameStatus = 0 GameStatus_WhiteWin GameStatus = 1 GameStatus_BlackWin GameStatus = 2 GameStatus_Draw GameStatus = 3 )
func (GameStatus) Descriptor ¶
func (GameStatus) Descriptor() protoreflect.EnumDescriptor
func (GameStatus) Enum ¶
func (x GameStatus) Enum() *GameStatus
func (GameStatus) EnumDescriptor
deprecated
func (GameStatus) EnumDescriptor() ([]byte, []int)
Deprecated: Use GameStatus.Descriptor instead.
func (GameStatus) Number ¶
func (x GameStatus) Number() protoreflect.EnumNumber
func (GameStatus) String ¶
func (x GameStatus) String() string
func (GameStatus) Type ¶
func (GameStatus) Type() protoreflect.EnumType
type GetGameRoomByEmailRequest ¶
type GetGameRoomByEmailRequest struct { Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` // contains filtered or unexported fields }
获取游戏房间请求
func (*GetGameRoomByEmailRequest) Descriptor
deprecated
func (*GetGameRoomByEmailRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetGameRoomByEmailRequest.ProtoReflect.Descriptor instead.
func (*GetGameRoomByEmailRequest) GetEmail ¶
func (x *GetGameRoomByEmailRequest) GetEmail() string
func (*GetGameRoomByEmailRequest) ProtoMessage ¶
func (*GetGameRoomByEmailRequest) ProtoMessage()
func (*GetGameRoomByEmailRequest) ProtoReflect ¶
func (x *GetGameRoomByEmailRequest) ProtoReflect() protoreflect.Message
func (*GetGameRoomByEmailRequest) Reset ¶
func (x *GetGameRoomByEmailRequest) Reset()
func (*GetGameRoomByEmailRequest) String ¶
func (x *GetGameRoomByEmailRequest) String() string
type GetGameRoomByEmailResponse ¶
type GetGameRoomByEmailResponse struct { GameRoom *GameRoom `protobuf:"bytes,1,opt,name=game_room,json=gameRoom,proto3" json:"game_room,omitempty"` Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
获取游戏房间响应
func (*GetGameRoomByEmailResponse) Descriptor
deprecated
func (*GetGameRoomByEmailResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetGameRoomByEmailResponse.ProtoReflect.Descriptor instead.
func (*GetGameRoomByEmailResponse) GetError ¶
func (x *GetGameRoomByEmailResponse) GetError() string
func (*GetGameRoomByEmailResponse) GetGameRoom ¶
func (x *GetGameRoomByEmailResponse) GetGameRoom() *GameRoom
func (*GetGameRoomByEmailResponse) ProtoMessage ¶
func (*GetGameRoomByEmailResponse) ProtoMessage()
func (*GetGameRoomByEmailResponse) ProtoReflect ¶
func (x *GetGameRoomByEmailResponse) ProtoReflect() protoreflect.Message
func (*GetGameRoomByEmailResponse) Reset ¶
func (x *GetGameRoomByEmailResponse) Reset()
func (*GetGameRoomByEmailResponse) String ¶
func (x *GetGameRoomByEmailResponse) String() string
type GetMessageListRequest ¶
type GetMessageListRequest struct { RoomId string `protobuf:"bytes,1,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"` // contains filtered or unexported fields }
获取消息列表请求
func (*GetMessageListRequest) Descriptor
deprecated
func (*GetMessageListRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetMessageListRequest.ProtoReflect.Descriptor instead.
func (*GetMessageListRequest) GetRoomId ¶
func (x *GetMessageListRequest) GetRoomId() string
func (*GetMessageListRequest) ProtoMessage ¶
func (*GetMessageListRequest) ProtoMessage()
func (*GetMessageListRequest) ProtoReflect ¶
func (x *GetMessageListRequest) ProtoReflect() protoreflect.Message
func (*GetMessageListRequest) Reset ¶
func (x *GetMessageListRequest) Reset()
func (*GetMessageListRequest) String ¶
func (x *GetMessageListRequest) String() string
type GetMessageListResponse ¶
type GetMessageListResponse struct { Messages *MessageList `protobuf:"bytes,1,opt,name=messages,proto3" json:"messages,omitempty"` // contains filtered or unexported fields }
获取消息列表响应
func (*GetMessageListResponse) Descriptor
deprecated
func (*GetMessageListResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetMessageListResponse.ProtoReflect.Descriptor instead.
func (*GetMessageListResponse) GetMessages ¶
func (x *GetMessageListResponse) GetMessages() *MessageList
func (*GetMessageListResponse) ProtoMessage ¶
func (*GetMessageListResponse) ProtoMessage()
func (*GetMessageListResponse) ProtoReflect ¶
func (x *GetMessageListResponse) ProtoReflect() protoreflect.Message
func (*GetMessageListResponse) Reset ¶
func (x *GetMessageListResponse) Reset()
func (*GetMessageListResponse) String ¶
func (x *GetMessageListResponse) String() string
type GetUserInfoRequest ¶
type GetUserInfoRequest struct { Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` // contains filtered or unexported fields }
func (*GetUserInfoRequest) Descriptor
deprecated
func (*GetUserInfoRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetUserInfoRequest.ProtoReflect.Descriptor instead.
func (*GetUserInfoRequest) GetEmail ¶
func (x *GetUserInfoRequest) GetEmail() string
func (*GetUserInfoRequest) ProtoMessage ¶
func (*GetUserInfoRequest) ProtoMessage()
func (*GetUserInfoRequest) ProtoReflect ¶
func (x *GetUserInfoRequest) ProtoReflect() protoreflect.Message
func (*GetUserInfoRequest) Reset ¶
func (x *GetUserInfoRequest) Reset()
func (*GetUserInfoRequest) String ¶
func (x *GetUserInfoRequest) String() string
type GetUserInfoResponse ¶
type GetUserInfoResponse struct { Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` User *User `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` // contains filtered or unexported fields }
func (*GetUserInfoResponse) Descriptor
deprecated
func (*GetUserInfoResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetUserInfoResponse.ProtoReflect.Descriptor instead.
func (*GetUserInfoResponse) GetError ¶
func (x *GetUserInfoResponse) GetError() string
func (*GetUserInfoResponse) GetUser ¶
func (x *GetUserInfoResponse) GetUser() *User
func (*GetUserInfoResponse) ProtoMessage ¶
func (*GetUserInfoResponse) ProtoMessage()
func (*GetUserInfoResponse) ProtoReflect ¶
func (x *GetUserInfoResponse) ProtoReflect() protoreflect.Message
func (*GetUserInfoResponse) Reset ¶
func (x *GetUserInfoResponse) Reset()
func (*GetUserInfoResponse) String ¶
func (x *GetUserInfoResponse) String() string
type Gobang ¶
type Gobang struct { // 棋盘大小 BoardSize int32 `protobuf:"varint,1,opt,name=board_size,json=boardSize,proto3" json:"board_size,omitempty"` // 压缩的棋盘 CompressedBoard []byte `protobuf:"bytes,2,opt,name=compressed_board,json=compressedBoard,proto3" json:"compressed_board,omitempty"` // 游戏状态 Status GameStatus `protobuf:"varint,3,opt,name=status,proto3,enum=gobang.GameStatus" json:"status,omitempty"` // 当前落子颜色 CurrentColor GobangColor `protobuf:"varint,4,opt,name=current_color,json=currentColor,proto3,enum=gobang.GobangColor" json:"current_color,omitempty"` // contains filtered or unexported fields }
五子棋游戏
func (*Gobang) Descriptor
deprecated
func (*Gobang) GetBoardSize ¶
func (*Gobang) GetCompressedBoard ¶
func (*Gobang) GetCurrentColor ¶
func (x *Gobang) GetCurrentColor() GobangColor
func (*Gobang) GetStatus ¶
func (x *Gobang) GetStatus() GameStatus
func (*Gobang) ProtoMessage ¶
func (*Gobang) ProtoMessage()
func (*Gobang) ProtoReflect ¶
func (x *Gobang) ProtoReflect() protoreflect.Message
type GobangCell ¶
type GobangCell int32
棋盘方格
const ( GobangCell_EmptyCell GobangCell = 0 GobangCell_WhiteCell GobangCell = 1 GobangCell_BlackCell GobangCell = 2 )
func (GobangCell) Descriptor ¶
func (GobangCell) Descriptor() protoreflect.EnumDescriptor
func (GobangCell) Enum ¶
func (x GobangCell) Enum() *GobangCell
func (GobangCell) EnumDescriptor
deprecated
func (GobangCell) EnumDescriptor() ([]byte, []int)
Deprecated: Use GobangCell.Descriptor instead.
func (GobangCell) Number ¶
func (x GobangCell) Number() protoreflect.EnumNumber
func (GobangCell) String ¶
func (x GobangCell) String() string
func (GobangCell) Type ¶
func (GobangCell) Type() protoreflect.EnumType
type GobangColor ¶
type GobangColor int32
棋子颜色
const ( GobangColor_White GobangColor = 0 GobangColor_Black GobangColor = 1 )
func (GobangColor) Descriptor ¶
func (GobangColor) Descriptor() protoreflect.EnumDescriptor
func (GobangColor) Enum ¶
func (x GobangColor) Enum() *GobangColor
func (GobangColor) EnumDescriptor
deprecated
func (GobangColor) EnumDescriptor() ([]byte, []int)
Deprecated: Use GobangColor.Descriptor instead.
func (GobangColor) Number ¶
func (x GobangColor) Number() protoreflect.EnumNumber
func (GobangColor) String ¶
func (x GobangColor) String() string
func (GobangColor) Type ¶
func (GobangColor) Type() protoreflect.EnumType
type GobangResult ¶
type GobangResult int32
五子棋结果
const ( GobangResult_Success GobangResult = 0 GobangResult_InvalidMove GobangResult = 1 GobangResult_GameOver GobangResult = 2 GobangResult_RoomNotFound GobangResult = 3 GobangResult_PlayerNotInRoom GobangResult = 4 GobangResult_NotYourTurn GobangResult = 5 // 服务器错误 GobangResult_ServerError GobangResult = 6 )
func (GobangResult) Descriptor ¶
func (GobangResult) Descriptor() protoreflect.EnumDescriptor
func (GobangResult) Enum ¶
func (x GobangResult) Enum() *GobangResult
func (GobangResult) EnumDescriptor
deprecated
func (GobangResult) EnumDescriptor() ([]byte, []int)
Deprecated: Use GobangResult.Descriptor instead.
func (GobangResult) Number ¶
func (x GobangResult) Number() protoreflect.EnumNumber
func (GobangResult) String ¶
func (x GobangResult) String() string
func (GobangResult) Type ¶
func (GobangResult) Type() protoreflect.EnumType
type JoinQueueResult ¶
type JoinQueueResult int32
加入匹配结果
const ( JoinQueueResult_Success JoinQueueResult = 0 JoinQueueResult_PlayerAlreadyInQueue JoinQueueResult = 1 JoinQueueResult_PlayerAlreadyInGame JoinQueueResult = 2 )
func (JoinQueueResult) Descriptor ¶
func (JoinQueueResult) Descriptor() protoreflect.EnumDescriptor
func (JoinQueueResult) Enum ¶
func (x JoinQueueResult) Enum() *JoinQueueResult
func (JoinQueueResult) EnumDescriptor
deprecated
func (JoinQueueResult) EnumDescriptor() ([]byte, []int)
Deprecated: Use JoinQueueResult.Descriptor instead.
func (JoinQueueResult) Number ¶
func (x JoinQueueResult) Number() protoreflect.EnumNumber
func (JoinQueueResult) String ¶
func (x JoinQueueResult) String() string
func (JoinQueueResult) Type ¶
func (JoinQueueResult) Type() protoreflect.EnumType
type JoinRequest ¶
type JoinRequest struct { Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` Elo int32 `protobuf:"varint,2,opt,name=elo,proto3" json:"elo,omitempty"` // contains filtered or unexported fields }
加入匹配的请求
func (*JoinRequest) Descriptor
deprecated
func (*JoinRequest) Descriptor() ([]byte, []int)
Deprecated: Use JoinRequest.ProtoReflect.Descriptor instead.
func (*JoinRequest) GetElo ¶
func (x *JoinRequest) GetElo() int32
func (*JoinRequest) GetEmail ¶
func (x *JoinRequest) GetEmail() string
func (*JoinRequest) ProtoMessage ¶
func (*JoinRequest) ProtoMessage()
func (*JoinRequest) ProtoReflect ¶
func (x *JoinRequest) ProtoReflect() protoreflect.Message
func (*JoinRequest) Reset ¶
func (x *JoinRequest) Reset()
func (*JoinRequest) String ¶
func (x *JoinRequest) String() string
type JoinResponse ¶
type JoinResponse struct { Result JoinQueueResult `protobuf:"varint,1,opt,name=result,proto3,enum=match.JoinQueueResult" json:"result,omitempty"` // contains filtered or unexported fields }
加入匹配的响应
func (*JoinResponse) Descriptor
deprecated
func (*JoinResponse) Descriptor() ([]byte, []int)
Deprecated: Use JoinResponse.ProtoReflect.Descriptor instead.
func (*JoinResponse) GetResult ¶
func (x *JoinResponse) GetResult() JoinQueueResult
func (*JoinResponse) ProtoMessage ¶
func (*JoinResponse) ProtoMessage()
func (*JoinResponse) ProtoReflect ¶
func (x *JoinResponse) ProtoReflect() protoreflect.Message
func (*JoinResponse) Reset ¶
func (x *JoinResponse) Reset()
func (*JoinResponse) String ¶
func (x *JoinResponse) String() string
type LoginRequest ¶
type LoginRequest struct { Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // contains filtered or unexported fields }
func (*LoginRequest) Descriptor
deprecated
func (*LoginRequest) Descriptor() ([]byte, []int)
Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead.
func (*LoginRequest) GetEmail ¶
func (x *LoginRequest) GetEmail() string
func (*LoginRequest) GetPassword ¶
func (x *LoginRequest) GetPassword() string
func (*LoginRequest) ProtoMessage ¶
func (*LoginRequest) ProtoMessage()
func (*LoginRequest) ProtoReflect ¶
func (x *LoginRequest) ProtoReflect() protoreflect.Message
func (*LoginRequest) Reset ¶
func (x *LoginRequest) Reset()
func (*LoginRequest) String ¶
func (x *LoginRequest) String() string
type LoginResponse ¶
type LoginResponse struct { Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` // contains filtered or unexported fields }
func (*LoginResponse) Descriptor
deprecated
func (*LoginResponse) Descriptor() ([]byte, []int)
Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead.
func (*LoginResponse) GetEmail ¶
func (x *LoginResponse) GetEmail() string
func (*LoginResponse) GetError ¶
func (x *LoginResponse) GetError() string
func (*LoginResponse) ProtoMessage ¶
func (*LoginResponse) ProtoMessage()
func (*LoginResponse) ProtoReflect ¶
func (x *LoginResponse) ProtoReflect() protoreflect.Message
func (*LoginResponse) Reset ¶
func (x *LoginResponse) Reset()
func (*LoginResponse) String ¶
func (x *LoginResponse) String() string
type MatchBroacastMessage ¶
type MatchBroacastMessage struct { RoomId string `protobuf:"bytes,1,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"` WhitePlayerEmail string `protobuf:"bytes,2,opt,name=white_player_email,json=whitePlayerEmail,proto3" json:"white_player_email,omitempty"` BlackPlayerEmail string `protobuf:"bytes,3,opt,name=black_player_email,json=blackPlayerEmail,proto3" json:"black_player_email,omitempty"` // contains filtered or unexported fields }
匹配结果的广播消息
func (*MatchBroacastMessage) Descriptor
deprecated
func (*MatchBroacastMessage) Descriptor() ([]byte, []int)
Deprecated: Use MatchBroacastMessage.ProtoReflect.Descriptor instead.
func (*MatchBroacastMessage) GetBlackPlayerEmail ¶
func (x *MatchBroacastMessage) GetBlackPlayerEmail() string
func (*MatchBroacastMessage) GetRoomId ¶
func (x *MatchBroacastMessage) GetRoomId() string
func (*MatchBroacastMessage) GetWhitePlayerEmail ¶
func (x *MatchBroacastMessage) GetWhitePlayerEmail() string
func (*MatchBroacastMessage) ProtoMessage ¶
func (*MatchBroacastMessage) ProtoMessage()
func (*MatchBroacastMessage) ProtoReflect ¶
func (x *MatchBroacastMessage) ProtoReflect() protoreflect.Message
func (*MatchBroacastMessage) Reset ¶
func (x *MatchBroacastMessage) Reset()
func (*MatchBroacastMessage) String ¶
func (x *MatchBroacastMessage) String() string
type MatchServiceClient ¶
type MatchServiceClient interface {
JoinQueue(ctx context.Context, in *JoinRequest, opts ...grpc.CallOption) (*JoinResponse, error)
}
MatchServiceClient is the client API for MatchService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
匹配服务
func NewMatchServiceClient ¶
func NewMatchServiceClient(cc grpc.ClientConnInterface) MatchServiceClient
type MatchServiceServer ¶
type MatchServiceServer interface { JoinQueue(context.Context, *JoinRequest) (*JoinResponse, error) // contains filtered or unexported methods }
MatchServiceServer is the server API for MatchService service. All implementations must embed UnimplementedMatchServiceServer for forward compatibility.
匹配服务
type Message ¶
type Message struct { // 消息内容 Content string `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` // 发送者邮箱 SenderEmail string `protobuf:"bytes,2,opt,name=sender_email,json=senderEmail,proto3" json:"sender_email,omitempty"` // 在哪个房间发送的 RoomId string `protobuf:"bytes,3,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"` // contains filtered or unexported fields }
func (*Message) Descriptor
deprecated
func (*Message) GetContent ¶
func (*Message) GetSenderEmail ¶
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) ProtoReflect ¶
func (x *Message) ProtoReflect() protoreflect.Message
type MessageList ¶
type MessageList struct { Messages []*Message `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` // contains filtered or unexported fields }
消息列表
func (*MessageList) Descriptor
deprecated
func (*MessageList) Descriptor() ([]byte, []int)
Deprecated: Use MessageList.ProtoReflect.Descriptor instead.
func (*MessageList) GetMessages ¶
func (x *MessageList) GetMessages() []*Message
func (*MessageList) ProtoMessage ¶
func (*MessageList) ProtoMessage()
func (*MessageList) ProtoReflect ¶
func (x *MessageList) ProtoReflect() protoreflect.Message
func (*MessageList) Reset ¶
func (x *MessageList) Reset()
func (*MessageList) String ¶
func (x *MessageList) String() string
type MoveBroadcastMessage ¶
type MoveBroadcastMessage struct { RoomId string `protobuf:"bytes,1,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"` X int32 `protobuf:"varint,2,opt,name=x,proto3" json:"x,omitempty"` Y int32 `protobuf:"varint,3,opt,name=y,proto3" json:"y,omitempty"` // 进行落子的玩家 From *Player `protobuf:"bytes,4,opt,name=from,proto3" json:"from,omitempty"` // 对手 To *Player `protobuf:"bytes,5,opt,name=to,proto3" json:"to,omitempty"` // contains filtered or unexported fields }
落子广播消息
func (*MoveBroadcastMessage) Descriptor
deprecated
func (*MoveBroadcastMessage) Descriptor() ([]byte, []int)
Deprecated: Use MoveBroadcastMessage.ProtoReflect.Descriptor instead.
func (*MoveBroadcastMessage) GetFrom ¶
func (x *MoveBroadcastMessage) GetFrom() *Player
func (*MoveBroadcastMessage) GetRoomId ¶
func (x *MoveBroadcastMessage) GetRoomId() string
func (*MoveBroadcastMessage) GetTo ¶
func (x *MoveBroadcastMessage) GetTo() *Player
func (*MoveBroadcastMessage) GetX ¶
func (x *MoveBroadcastMessage) GetX() int32
func (*MoveBroadcastMessage) GetY ¶
func (x *MoveBroadcastMessage) GetY() int32
func (*MoveBroadcastMessage) ProtoMessage ¶
func (*MoveBroadcastMessage) ProtoMessage()
func (*MoveBroadcastMessage) ProtoReflect ¶
func (x *MoveBroadcastMessage) ProtoReflect() protoreflect.Message
func (*MoveBroadcastMessage) Reset ¶
func (x *MoveBroadcastMessage) Reset()
func (*MoveBroadcastMessage) String ¶
func (x *MoveBroadcastMessage) String() string
type MoveRequest ¶
type MoveRequest struct { RoomId string `protobuf:"bytes,1,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"` PlayerEmail string `protobuf:"bytes,2,opt,name=player_email,json=playerEmail,proto3" json:"player_email,omitempty"` X int32 `protobuf:"varint,3,opt,name=x,proto3" json:"x,omitempty"` Y int32 `protobuf:"varint,4,opt,name=y,proto3" json:"y,omitempty"` // contains filtered or unexported fields }
落子请求
func (*MoveRequest) Descriptor
deprecated
func (*MoveRequest) Descriptor() ([]byte, []int)
Deprecated: Use MoveRequest.ProtoReflect.Descriptor instead.
func (*MoveRequest) GetPlayerEmail ¶
func (x *MoveRequest) GetPlayerEmail() string
func (*MoveRequest) GetRoomId ¶
func (x *MoveRequest) GetRoomId() string
func (*MoveRequest) GetX ¶
func (x *MoveRequest) GetX() int32
func (*MoveRequest) GetY ¶
func (x *MoveRequest) GetY() int32
func (*MoveRequest) ProtoMessage ¶
func (*MoveRequest) ProtoMessage()
func (*MoveRequest) ProtoReflect ¶
func (x *MoveRequest) ProtoReflect() protoreflect.Message
func (*MoveRequest) Reset ¶
func (x *MoveRequest) Reset()
func (*MoveRequest) String ¶
func (x *MoveRequest) String() string
type MoveResponse ¶
type MoveResponse struct { Result GobangResult `protobuf:"varint,1,opt,name=result,proto3,enum=gobang.GobangResult" json:"result,omitempty"` // contains filtered or unexported fields }
落子响应
func (*MoveResponse) Descriptor
deprecated
func (*MoveResponse) Descriptor() ([]byte, []int)
Deprecated: Use MoveResponse.ProtoReflect.Descriptor instead.
func (*MoveResponse) GetResult ¶
func (x *MoveResponse) GetResult() GobangResult
func (*MoveResponse) ProtoMessage ¶
func (*MoveResponse) ProtoMessage()
func (*MoveResponse) ProtoReflect ¶
func (x *MoveResponse) ProtoReflect() protoreflect.Message
func (*MoveResponse) Reset ¶
func (x *MoveResponse) Reset()
func (*MoveResponse) String ¶
func (x *MoveResponse) String() string
type Player ¶
type Player struct { Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` Color GobangColor `protobuf:"varint,2,opt,name=color,proto3,enum=gobang.GobangColor" json:"color,omitempty"` RoomId string `protobuf:"bytes,3,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"` // contains filtered or unexported fields }
玩家
func (*Player) Descriptor
deprecated
func (*Player) GetColor ¶
func (x *Player) GetColor() GobangColor
func (*Player) ProtoMessage ¶
func (*Player) ProtoMessage()
func (*Player) ProtoReflect ¶
func (x *Player) ProtoReflect() protoreflect.Message
type RegisterRequest ¶
type RegisterRequest struct { Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` // contains filtered or unexported fields }
func (*RegisterRequest) Descriptor
deprecated
func (*RegisterRequest) Descriptor() ([]byte, []int)
Deprecated: Use RegisterRequest.ProtoReflect.Descriptor instead.
func (*RegisterRequest) GetEmail ¶
func (x *RegisterRequest) GetEmail() string
func (*RegisterRequest) GetPassword ¶
func (x *RegisterRequest) GetPassword() string
func (*RegisterRequest) GetUsername ¶
func (x *RegisterRequest) GetUsername() string
func (*RegisterRequest) ProtoMessage ¶
func (*RegisterRequest) ProtoMessage()
func (*RegisterRequest) ProtoReflect ¶
func (x *RegisterRequest) ProtoReflect() protoreflect.Message
func (*RegisterRequest) Reset ¶
func (x *RegisterRequest) Reset()
func (*RegisterRequest) String ¶
func (x *RegisterRequest) String() string
type RegisterResponse ¶
type RegisterResponse struct { Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
func (*RegisterResponse) Descriptor
deprecated
func (*RegisterResponse) Descriptor() ([]byte, []int)
Deprecated: Use RegisterResponse.ProtoReflect.Descriptor instead.
func (*RegisterResponse) GetError ¶
func (x *RegisterResponse) GetError() string
func (*RegisterResponse) ProtoMessage ¶
func (*RegisterResponse) ProtoMessage()
func (*RegisterResponse) ProtoReflect ¶
func (x *RegisterResponse) ProtoReflect() protoreflect.Message
func (*RegisterResponse) Reset ¶
func (x *RegisterResponse) Reset()
func (*RegisterResponse) String ¶
func (x *RegisterResponse) String() string
type SendMessageRequest ¶
type SendMessageRequest struct { Message *Message `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
发送消息请求
func (*SendMessageRequest) Descriptor
deprecated
func (*SendMessageRequest) Descriptor() ([]byte, []int)
Deprecated: Use SendMessageRequest.ProtoReflect.Descriptor instead.
func (*SendMessageRequest) GetMessage ¶
func (x *SendMessageRequest) GetMessage() *Message
func (*SendMessageRequest) ProtoMessage ¶
func (*SendMessageRequest) ProtoMessage()
func (*SendMessageRequest) ProtoReflect ¶
func (x *SendMessageRequest) ProtoReflect() protoreflect.Message
func (*SendMessageRequest) Reset ¶
func (x *SendMessageRequest) Reset()
func (*SendMessageRequest) String ¶
func (x *SendMessageRequest) String() string
type SendMessageResponse ¶
type SendMessageResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // contains filtered or unexported fields }
发送消息响应
func (*SendMessageResponse) Descriptor
deprecated
func (*SendMessageResponse) Descriptor() ([]byte, []int)
Deprecated: Use SendMessageResponse.ProtoReflect.Descriptor instead.
func (*SendMessageResponse) GetSuccess ¶
func (x *SendMessageResponse) GetSuccess() bool
func (*SendMessageResponse) ProtoMessage ¶
func (*SendMessageResponse) ProtoMessage()
func (*SendMessageResponse) ProtoReflect ¶
func (x *SendMessageResponse) ProtoReflect() protoreflect.Message
func (*SendMessageResponse) Reset ¶
func (x *SendMessageResponse) Reset()
func (*SendMessageResponse) String ¶
func (x *SendMessageResponse) String() string
type SetUserStatusRequest ¶ added in v0.1.1
type SetUserStatusRequest struct { Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` Status UserStatus `protobuf:"varint,2,opt,name=status,proto3,enum=user.UserStatus" json:"status,omitempty"` // contains filtered or unexported fields }
func (*SetUserStatusRequest) Descriptor
deprecated
added in
v0.1.1
func (*SetUserStatusRequest) Descriptor() ([]byte, []int)
Deprecated: Use SetUserStatusRequest.ProtoReflect.Descriptor instead.
func (*SetUserStatusRequest) GetEmail ¶ added in v0.1.1
func (x *SetUserStatusRequest) GetEmail() string
func (*SetUserStatusRequest) GetStatus ¶ added in v0.1.1
func (x *SetUserStatusRequest) GetStatus() UserStatus
func (*SetUserStatusRequest) ProtoMessage ¶ added in v0.1.1
func (*SetUserStatusRequest) ProtoMessage()
func (*SetUserStatusRequest) ProtoReflect ¶ added in v0.1.1
func (x *SetUserStatusRequest) ProtoReflect() protoreflect.Message
func (*SetUserStatusRequest) Reset ¶ added in v0.1.1
func (x *SetUserStatusRequest) Reset()
func (*SetUserStatusRequest) String ¶ added in v0.1.1
func (x *SetUserStatusRequest) String() string
type SetUserStatusResponse ¶ added in v0.1.1
type SetUserStatusResponse struct { Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
func (*SetUserStatusResponse) Descriptor
deprecated
added in
v0.1.1
func (*SetUserStatusResponse) Descriptor() ([]byte, []int)
Deprecated: Use SetUserStatusResponse.ProtoReflect.Descriptor instead.
func (*SetUserStatusResponse) GetError ¶ added in v0.1.1
func (x *SetUserStatusResponse) GetError() string
func (*SetUserStatusResponse) ProtoMessage ¶ added in v0.1.1
func (*SetUserStatusResponse) ProtoMessage()
func (*SetUserStatusResponse) ProtoReflect ¶ added in v0.1.1
func (x *SetUserStatusResponse) ProtoReflect() protoreflect.Message
func (*SetUserStatusResponse) Reset ¶ added in v0.1.1
func (x *SetUserStatusResponse) Reset()
func (*SetUserStatusResponse) String ¶ added in v0.1.1
func (x *SetUserStatusResponse) String() string
type UnimplementedChatServiceServer ¶
type UnimplementedChatServiceServer struct{}
UnimplementedChatServiceServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedChatServiceServer) GetMessageList ¶
func (UnimplementedChatServiceServer) GetMessageList(context.Context, *GetMessageListRequest) (*GetMessageListResponse, error)
func (UnimplementedChatServiceServer) SendMessage ¶
func (UnimplementedChatServiceServer) SendMessage(context.Context, *SendMessageRequest) (*SendMessageResponse, error)
type UnimplementedGameServiceServer ¶
type UnimplementedGameServiceServer struct{}
UnimplementedGameServiceServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedGameServiceServer) CreateRoom ¶
func (UnimplementedGameServiceServer) CreateRoom(context.Context, *CreateRoomRequest) (*CreateRoomResponse, error)
func (UnimplementedGameServiceServer) GetGameRoomByEmail ¶
func (UnimplementedGameServiceServer) GetGameRoomByEmail(context.Context, *GetGameRoomByEmailRequest) (*GetGameRoomByEmailResponse, error)
func (UnimplementedGameServiceServer) MakeMove ¶
func (UnimplementedGameServiceServer) MakeMove(context.Context, *MoveRequest) (*MoveResponse, error)
type UnimplementedMatchServiceServer ¶
type UnimplementedMatchServiceServer struct{}
UnimplementedMatchServiceServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedMatchServiceServer) JoinQueue ¶
func (UnimplementedMatchServiceServer) JoinQueue(context.Context, *JoinRequest) (*JoinResponse, error)
type UnimplementedUserServiceServer ¶
type UnimplementedUserServiceServer struct{}
UnimplementedUserServiceServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedUserServiceServer) GetUserInfo ¶
func (UnimplementedUserServiceServer) GetUserInfo(context.Context, *GetUserInfoRequest) (*GetUserInfoResponse, error)
func (UnimplementedUserServiceServer) Login ¶
func (UnimplementedUserServiceServer) Login(context.Context, *LoginRequest) (*LoginResponse, error)
func (UnimplementedUserServiceServer) Register ¶
func (UnimplementedUserServiceServer) Register(context.Context, *RegisterRequest) (*RegisterResponse, error)
func (UnimplementedUserServiceServer) SetUserStatus ¶ added in v0.1.1
func (UnimplementedUserServiceServer) SetUserStatus(context.Context, *SetUserStatusRequest) (*SetUserStatusResponse, error)
type UnsafeChatServiceServer ¶
type UnsafeChatServiceServer interface {
// contains filtered or unexported methods
}
UnsafeChatServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ChatServiceServer will result in compilation errors.
type UnsafeGameServiceServer ¶
type UnsafeGameServiceServer interface {
// contains filtered or unexported methods
}
UnsafeGameServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GameServiceServer will result in compilation errors.
type UnsafeMatchServiceServer ¶
type UnsafeMatchServiceServer interface {
// contains filtered or unexported methods
}
UnsafeMatchServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MatchServiceServer will result in compilation errors.
type UnsafeUserServiceServer ¶
type UnsafeUserServiceServer interface {
// contains filtered or unexported methods
}
UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to UserServiceServer will result in compilation errors.
type User ¶
type User struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` Elo int32 `protobuf:"varint,4,opt,name=elo,proto3" json:"elo,omitempty"` Status UserStatus `protobuf:"varint,5,opt,name=status,proto3,enum=user.UserStatus" json:"status,omitempty"` // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) GetStatus ¶
func (x *User) GetStatus() UserStatus
func (*User) GetUsername ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
type UserServiceClient ¶
type UserServiceClient interface { Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error) GetUserInfo(ctx context.Context, in *GetUserInfoRequest, opts ...grpc.CallOption) (*GetUserInfoResponse, error) SetUserStatus(ctx context.Context, in *SetUserStatusRequest, opts ...grpc.CallOption) (*SetUserStatusResponse, error) }
UserServiceClient is the client API for UserService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewUserServiceClient ¶
func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient
type UserServiceServer ¶
type UserServiceServer interface { Login(context.Context, *LoginRequest) (*LoginResponse, error) Register(context.Context, *RegisterRequest) (*RegisterResponse, error) GetUserInfo(context.Context, *GetUserInfoRequest) (*GetUserInfoResponse, error) SetUserStatus(context.Context, *SetUserStatusRequest) (*SetUserStatusResponse, error) // contains filtered or unexported methods }
UserServiceServer is the server API for UserService service. All implementations must embed UnimplementedUserServiceServer for forward compatibility.
type UserStatus ¶
type UserStatus int32
用户状态
const ( // 在线 UserStatus_Online UserStatus = 0 // 离线 UserStatus_Offline UserStatus = 1 // 游戏中 UserStatus_InGame UserStatus = 2 // 匹配中 UserStatus_Matching UserStatus = 3 )
func (UserStatus) Descriptor ¶
func (UserStatus) Descriptor() protoreflect.EnumDescriptor
func (UserStatus) Enum ¶
func (x UserStatus) Enum() *UserStatus
func (UserStatus) EnumDescriptor
deprecated
func (UserStatus) EnumDescriptor() ([]byte, []int)
Deprecated: Use UserStatus.Descriptor instead.
func (UserStatus) Number ¶
func (x UserStatus) Number() protoreflect.EnumNumber
func (UserStatus) String ¶
func (x UserStatus) String() string
func (UserStatus) Type ¶
func (UserStatus) Type() protoreflect.EnumType