Documentation ¶
Overview ¶
rpc_get_game_by_id.go
rpc_get_player_game.go
Index ¶
- func RateLimitMiddleware(r rate.Limit, b int) func(http.Handler) http.Handler
- type Metadata
- type Server
- func (server *Server) AcceptFriendRequest(ctx context.Context, req *pb.AcceptFriendRequestRequest) (*emptypb.Empty, error)
- func (server *Server) AcceptGameInvite(ctx context.Context, req *pb.AcceptGameInviteRequest) (*emptypb.Empty, error)
- func (server *Server) ActivateUser(ctx context.Context, req *pb.ActivateUserRequest) (*pb.ActivateUserResponse, error)
- func (server *Server) AddPlayerToGame(ctx context.Context, req *pb.AddPlayerToGameRequest) (*emptypb.Empty, error)
- func (server *Server) CheckUserSession(ctx context.Context, req *pb.CheckUserSessionRequest) (*pb.CheckUserSessionResponse, error)
- func (server *Server) CreateFriendship(ctx context.Context, req *pb.CreateFriendshipRequest) (*pb.CreateFriendshipResponse, error)
- func (server *Server) CreateGame(ctx context.Context, req *pb.CreateGameRequest) (*pb.CreateGameResponse, error)
- func (server *Server) CreateUser(ctx context.Context, req *pb.CreateUserRequest) (*pb.CreateUserResponse, error)
- func (server *Server) DrawCard(ctx context.Context, req *pb.DrawCardRequest) (*pb.DrawCardResponse, error)
- func (server *Server) GetGameByID(ctx context.Context, req *pb.GetGameByIDRequest) (*pb.GetGameByIDResponse, error)
- func (server *Server) GetPlayerGame(ctx context.Context, req *pb.GetPlayerGameRequest) (*pb.GetPlayerGameResponse, error)
- func (server *Server) GetPlayerHand(ctx context.Context, req *pb.GetPlayerHandRequest) (*pb.GetPlayerHandResponse, error)
- func (server *Server) InvitePlayersToGame(ctx context.Context, req *pb.InvitePlayersToGameRequest) (*emptypb.Empty, error)
- func (server *Server) ListActivePlayerGames(ctx context.Context, req *pb.ListPlayerGamesRequest) (*pb.ListPlayerGamesResponse, error)
- func (server *Server) ListFriendRequests(ctx context.Context, req *pb.ListFriendRequestsRequest) (*pb.ListFriendRequestsResponse, error)
- func (server *Server) ListGameInvites(ctx context.Context, req *pb.ListGameInvitesRequest) (*pb.ListGameInvitesResponse, error)
- func (server *Server) ListGamePlayers(ctx context.Context, req *pb.ListGamePlayersRequest) (*pb.ListGamePlayersResponse, error)
- func (server *Server) ListUserFriends(ctx context.Context, req *pb.ListUserFriendsRequest) (*pb.ListUserFriendsResponse, error)
- func (server *Server) LoginUser(ctx context.Context, req *pb.LoginUserRequest) (*pb.LoginUserResponse, error)
- func (server *Server) Logout(ctx context.Context, req *pb.LogoutRequest) (*emptypb.Empty, error)
- func (server *Server) PlayDessert(ctx context.Context, req *pb.PlayDessertRequest) (*pb.PlayDessertResponse, error)
- func (server *Server) RenewAccessToken(ctx context.Context, req *pb.RenewAccessRequest) (*pb.RenewAccessResponse, error)
- func (server *Server) StartGame(ctx context.Context, req *pb.StartGameRequest) (*pb.StartGameResponse, error)
- func (server *Server) UpdateUser(ctx context.Context, req *pb.UpdateUserRequest) (*pb.UpdateUserResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Server ¶
type Server struct { pb.UnimplementedDessertedServer Store db.Store // contains filtered or unexported fields }
Server serves gRPC requests for our desserted service.
func NewServer ¶
func NewServer(config util.Config, store db.Store, mailer *mailer.Mailer) (*Server, token.Maker, error)
NewServer creates a new gRPC server
func (*Server) AcceptFriendRequest ¶
func (server *Server) AcceptFriendRequest(ctx context.Context, req *pb.AcceptFriendRequestRequest) (*emptypb.Empty, error)
AcceptFriendRequest updates the status of a friend request to accepted.
func (*Server) AcceptGameInvite ¶
func (server *Server) AcceptGameInvite(ctx context.Context, req *pb.AcceptGameInviteRequest) (*emptypb.Empty, error)
AcceptGameInvite allows a user to accept an invitation to a game.
func (*Server) ActivateUser ¶
func (server *Server) ActivateUser(ctx context.Context, req *pb.ActivateUserRequest) (*pb.ActivateUserResponse, error)
func (*Server) AddPlayerToGame ¶
func (server *Server) AddPlayerToGame(ctx context.Context, req *pb.AddPlayerToGameRequest) (*emptypb.Empty, error)
Will use this functionality in the future if players want to "find an open game" Requires adding a private/public column to games
func (*Server) CheckUserSession ¶
func (server *Server) CheckUserSession(ctx context.Context, req *pb.CheckUserSessionRequest) (*pb.CheckUserSessionResponse, error)
func (*Server) CreateFriendship ¶
func (server *Server) CreateFriendship(ctx context.Context, req *pb.CreateFriendshipRequest) (*pb.CreateFriendshipResponse, error)
CreateFriendship creates a new friendship between two users.
func (*Server) CreateGame ¶
func (server *Server) CreateGame(ctx context.Context, req *pb.CreateGameRequest) (*pb.CreateGameResponse, error)
func (*Server) CreateUser ¶
func (server *Server) CreateUser(ctx context.Context, req *pb.CreateUserRequest) (*pb.CreateUserResponse, error)
func (*Server) DrawCard ¶
func (server *Server) DrawCard(ctx context.Context, req *pb.DrawCardRequest) (*pb.DrawCardResponse, error)
DrawCard handles the request to draw a card from the deck in a game session.
func (*Server) GetGameByID ¶
func (server *Server) GetGameByID(ctx context.Context, req *pb.GetGameByIDRequest) (*pb.GetGameByIDResponse, error)
GetGameByID retrieves the details of a game by its ID.
func (*Server) GetPlayerGame ¶
func (server *Server) GetPlayerGame(ctx context.Context, req *pb.GetPlayerGameRequest) (*pb.GetPlayerGameResponse, error)
GetPlayerGame retrieves the game data for a given player.
func (*Server) GetPlayerHand ¶
func (server *Server) GetPlayerHand(ctx context.Context, req *pb.GetPlayerHandRequest) (*pb.GetPlayerHandResponse, error)
GetPlayerHand retrieves the cards in a player's hand for a given game.
func (*Server) InvitePlayersToGame ¶
func (*Server) ListActivePlayerGames ¶
func (server *Server) ListActivePlayerGames(ctx context.Context, req *pb.ListPlayerGamesRequest) (*pb.ListPlayerGamesResponse, error)
ListActivePlayerGames lists active games for a player.
func (*Server) ListFriendRequests ¶
func (server *Server) ListFriendRequests(ctx context.Context, req *pb.ListFriendRequestsRequest) (*pb.ListFriendRequestsResponse, error)
ListFriendRequests lists all pending friend requests for a user.
func (*Server) ListGameInvites ¶
func (server *Server) ListGameInvites(ctx context.Context, req *pb.ListGameInvitesRequest) (*pb.ListGameInvitesResponse, error)
ListGameInvites lists all pending game invitations for a user.
func (*Server) ListGamePlayers ¶
func (server *Server) ListGamePlayers(ctx context.Context, req *pb.ListGamePlayersRequest) (*pb.ListGamePlayersResponse, error)
func (*Server) ListUserFriends ¶
func (server *Server) ListUserFriends(ctx context.Context, req *pb.ListUserFriendsRequest) (*pb.ListUserFriendsResponse, error)
ListUserFriends lists the friendships of a given user.
func (*Server) LoginUser ¶
func (server *Server) LoginUser(ctx context.Context, req *pb.LoginUserRequest) (*pb.LoginUserResponse, error)
func (*Server) PlayDessert ¶
func (server *Server) PlayDessert(ctx context.Context, req *pb.PlayDessertRequest) (*pb.PlayDessertResponse, error)
func (*Server) RenewAccessToken ¶
func (server *Server) RenewAccessToken(ctx context.Context, req *pb.RenewAccessRequest) (*pb.RenewAccessResponse, error)
func (*Server) StartGame ¶
func (server *Server) StartGame(ctx context.Context, req *pb.StartGameRequest) (*pb.StartGameResponse, error)
StartGame starts a game session.
func (*Server) UpdateUser ¶
func (server *Server) UpdateUser(ctx context.Context, req *pb.UpdateUserRequest) (*pb.UpdateUserResponse, error)
Source Files ¶
- authorization.go
- converter.go
- error.go
- metadata.go
- rate_limit.go
- rpc_accept_friend_request.go
- rpc_accept_game_invite.go
- rpc_activate_user.go
- rpc_add_player_to_game.go
- rpc_check_session.go
- rpc_create_friendship.go
- rpc_create_game.go
- rpc_create_user.go
- rpc_draw_card.go
- rpc_get_game_by_id.go
- rpc_get_player_game.go
- rpc_get_player_hand.go
- rpc_invite_player_to_game.go
- rpc_list_active_player_games.go
- rpc_list_friend_requests.go
- rpc_list_game_invites.go
- rpc_list_game_players.go
- rpc_list_user_friendships.go
- rpc_login_user.go
- rpc_logout.go
- rpc_play_dessert.go
- rpc_renew_access.go
- rpc_start_game.go
- rpc_update_user.go
- server.go