pb

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChatService_SendMessage_FullMethodName    = "/chat.ChatService/SendMessage"
	ChatService_GetMessageList_FullMethodName = "/chat.ChatService/GetMessageList"
)
View Source
const (
	GameService_CreateRoom_FullMethodName         = "/gobang.GameService/CreateRoom"
	GameService_MakeMove_FullMethodName           = "/gobang.GameService/MakeMove"
	GameService_GetGameRoomByEmail_FullMethodName = "/gobang.GameService/GetGameRoomByEmail"
)
View Source
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"
)
View Source
const (
	MatchService_JoinQueue_FullMethodName = "/match.MatchService/JoinQueue"
)

Variables

View Source
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.

View Source
var (
	GobangColor_name = map[int32]string{
		0: "White",
		1: "Black",
	}
	GobangColor_value = map[string]int32{
		"White": 0,
		"Black": 1,
	}
)

Enum value maps for GobangColor.

View Source
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.

View Source
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.

View Source
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.

View Source
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.

View Source
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)

View Source
var File_gobang_proto protoreflect.FileDescriptor
View Source
var File_match_proto protoreflect.FileDescriptor
View Source
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)

View Source
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)

View Source
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.

聊天服务

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) Descriptor() ([]byte, []int)

Deprecated: Use GameRoom.ProtoReflect.Descriptor instead.

func (*GameRoom) GetBlackPlayer

func (x *GameRoom) GetBlackPlayer() *Player

func (*GameRoom) GetGobang

func (x *GameRoom) GetGobang() *Gobang

func (*GameRoom) GetRoomId

func (x *GameRoom) GetRoomId() string

func (*GameRoom) GetWhitePlayer

func (x *GameRoom) GetWhitePlayer() *Player

func (*GameRoom) ProtoMessage

func (*GameRoom) ProtoMessage()

func (*GameRoom) ProtoReflect

func (x *GameRoom) ProtoReflect() protoreflect.Message

func (*GameRoom) Reset

func (x *GameRoom) Reset()

func (*GameRoom) String

func (x *GameRoom) String() string

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.

游戏服务

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

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 (*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 (*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) Descriptor() ([]byte, []int)

Deprecated: Use Gobang.ProtoReflect.Descriptor instead.

func (*Gobang) GetBoardSize

func (x *Gobang) GetBoardSize() int32

func (*Gobang) GetCompressedBoard

func (x *Gobang) GetCompressedBoard() []byte

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

func (*Gobang) Reset

func (x *Gobang) Reset()

func (*Gobang) String

func (x *Gobang) String() string

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

type GobangColor

type GobangColor int32

棋子颜色

const (
	GobangColor_White GobangColor = 0
	GobangColor_Black GobangColor = 1
)

func (GobangColor) Descriptor

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

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) Enum

func (x GobangResult) Enum() *GobangResult

func (GobangResult) EnumDescriptor deprecated

func (GobangResult) EnumDescriptor() ([]byte, []int)

Deprecated: Use GobangResult.Descriptor instead.

func (GobangResult) Number

func (GobangResult) String

func (x GobangResult) String() string

func (GobangResult) Type

type JoinQueueResult

type JoinQueueResult int32

加入匹配结果

const (
	JoinQueueResult_Success              JoinQueueResult = 0
	JoinQueueResult_PlayerAlreadyInQueue JoinQueueResult = 1
	JoinQueueResult_PlayerAlreadyInGame  JoinQueueResult = 2
)

func (JoinQueueResult) Descriptor

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 (JoinQueueResult) String

func (x JoinQueueResult) String() string

func (JoinQueueResult) Type

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.

匹配服务

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) Descriptor() ([]byte, []int)

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetContent

func (x *Message) GetContent() string

func (*Message) GetRoomId

func (x *Message) GetRoomId() string

func (*Message) GetSenderEmail

func (x *Message) GetSenderEmail() string

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

func (x *Message) ProtoReflect() protoreflect.Message

func (*Message) Reset

func (x *Message) Reset()

func (*Message) String

func (x *Message) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Player.ProtoReflect.Descriptor instead.

func (*Player) GetColor

func (x *Player) GetColor() GobangColor

func (*Player) GetEmail

func (x *Player) GetEmail() string

func (*Player) GetRoomId

func (x *Player) GetRoomId() string

func (*Player) ProtoMessage

func (*Player) ProtoMessage()

func (*Player) ProtoReflect

func (x *Player) ProtoReflect() protoreflect.Message

func (*Player) Reset

func (x *Player) Reset()

func (*Player) String

func (x *Player) String() string

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) SendMessage

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) GetGameRoomByEmail

func (UnimplementedGameServiceServer) MakeMove

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

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) Login

func (UnimplementedUserServiceServer) Register

func (UnimplementedUserServiceServer) SetUserStatus added in v0.1.1

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) Descriptor() ([]byte, []int)

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetElo

func (x *User) GetElo() int32

func (*User) GetEmail

func (x *User) GetEmail() string

func (*User) GetId

func (x *User) GetId() string

func (*User) GetStatus

func (x *User) GetStatus() UserStatus

func (*User) GetUsername

func (x *User) GetUsername() string

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

func (x *User) ProtoReflect() protoreflect.Message

func (*User) Reset

func (x *User) Reset()

func (*User) String

func (x *User) String() string

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.

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL