Documentation ¶
Index ¶
- type API
- func (api *API) AcceptInvite(c *gin.Context)
- func (api *API) CancelMatch(c *gin.Context)
- func (api *API) ChangeRole(c *gin.Context)
- func (api *API) CreateGroup(c *gin.Context)
- func (api *API) DissolveGroup(c *gin.Context)
- func (api *API) EnterGroup(c *gin.Context)
- func (api *API) ExitGame(c *gin.Context)
- func (api *API) ExitGroup(c *gin.Context)
- func (api *API) Invite(c *gin.Context)
- func (api *API) KickPlayer(c *gin.Context)
- func (api *API) Ready(c *gin.Context)
- func (api *API) RefuseInvite(c *gin.Context)
- func (api *API) SetNearbyJoinGroup(c *gin.Context)
- func (api *API) SetRecentJoinGroup(c *gin.Context)
- func (api *API) SetVoiceState(c *gin.Context)
- func (api *API) StartMatch(c *gin.Context)
- func (api *API) Unready(c *gin.Context)
- func (api *API) UploadPlayerAttr(c *gin.Context)
- type AcceptInviteReq
- type ChangeRoleReq
- type CreateGroupRsp
- type EnterGroupReq
- type ExitGameReq
- type ExitGroupReq
- type Infra
- type InviteReq
- type KickPlayerReq
- type RefuseInviteReq
- type SetNearbyJoinGroupReq
- type SetRecentJoinGroupReq
- type SetVoiceStateReq
- type UploadPlayerAttrReq
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
*internalapi.API
}
func (*API) AcceptInvite ¶
AcceptInvite godoc @Summary accept an invitation @Description accept an invitation based on the request @Tags match service @Accept json @Produce json @Param x-request-id header string false "Request ID" @Param AcceptInviteReq body AcceptInviteReq true "Accept Invite Request Body" @Success 200 {object} string "ok" @Failure 400 {object} string "Bad Request" @Failure 200 {object} string "Concrete Error Msg" @Router /match/accept_invite [post]
func (*API) CancelMatch ¶
CancelMatch godoc @Summary cancel match @Description cancel match @Tags match service @Accept json @Produce json @Param x-request-id header string false "Request ID" @Param uid path string true "player uid" @Success 200 {object} string "ok" @Failure 400 {object} string "Bad Request" @Failure 200 {object} string "Concrete Error Msg" @Router /match/cancel_match/{uid} [post]
func (*API) ChangeRole ¶
ChangeRole godoc @Summary change a player's role @Description change a player's role based on the request @Tags match service @Accept json @Produce json @Param x-request-id header string false "Request ID" @Param ChangeRoleReq body ChangeRoleReq true "Change Role Request Body" @Success 200 {object} string "ok" @Failure 400 {object} string "Bad Request" @Failure 200 {object} string "Concrete Error Msg" @Router /match/change_role [post]
func (*API) CreateGroup ¶
CreateGroup godoc @Summary create a new group @Description create a new group based on the request @Tags match service @Accept json @Produce json @Param x-request-id header string false "Request ID" @Param CreateGroup body pto.CreateGroup true "Create Group Request Body" @Success 200 {object} CreateGroupRsp @Failure 200 {object} string @Router /match/create_group [post]
func (*API) DissolveGroup ¶
DissolveGroup godoc @Summary dissolve a group @Description dissolve a group based on the request @Tags match service @Accept json @Produce json @Param x-request-id header string false "Request ID" @Param uid path string true "User ID" @Success 200 {object} string "ok" @Failure 200 {object} string "Concrete Error Msg" @Router /match/dissolve_group/{uid} [post]
func (*API) EnterGroup ¶
EnterGroup godoc @Summary enter a group @Description enter a group based on the request @Tags match service @Accept json @Produce json @Param x-request-id header string false "Request ID" @Param EnterGroupReq body EnterGroupReq true "Enter Group Request Body" @Success 200 {object} string "ok" @Failure 400 {object} string "Bad Request" @Failure 200 {object} string "Concrete Error Msg" @Router /match/enter_group [post]
func (*API) ExitGame ¶
ExitGame godoc @Summary exit game @Description exit game @Tags match service @Accept json @Produce json @Param x-request-id header string false "Request ID" @Param ExitGameReq body ExitGameReq true "Exit Game Request Body" @Success 200 {object} string "ok" @Failure 400 {object} string "Bad Request" @Failure 200 {object} string "Concrete Error Msg" @Router /match/exit_game [post]
func (*API) ExitGroup ¶
ExitGroup godoc @Summary exit a group @Description exit a group based on the request @Tags match service @Accept json @Produce json @Param x-request-id header string false "Request ID" @Param uid path string true "User ID" @Success 200 {object} string "ok" @Failure 200 {object} string "Concrete Error Msg" @Router /match/exit_group/{uid} [post]
func (*API) Invite ¶
Invite godoc @Summary invite a player @Description invite a player based on the request @Tags match service @Accept json @Produce json @Param x-request-id header string false "Request ID" @Param InviteReq body InviteReq true "Invite Request Body" @Success 200 {object} string "ok" @Failure 400 {object} string "Bad Request" @Failure 200 {object} string "Concrete Error Msg" @Router /match/invite [post]
func (*API) KickPlayer ¶
KickPlayer godoc @Summary kick a player @Description kick a player based on the request @Tags match service @Accept json @Produce json @Param x-request-id header string false "Request ID" @Param KickPlayerReq body KickPlayerReq true "Kick Player Request Body" @Success 200 {object} string "ok" @Failure 400 {object} string "Bad Request" @Failure 200 {object} string "Concrete Error Msg" @Router /match/kick_player [post]
func (*API) Ready ¶
Ready godoc @Summary ready @Description ready @Tags match service @Accept json @Produce json @Param x-request-id header string false "Request ID" @Param uid path string true "player uid" @Success 200 {object} string "ok" @Failure 400 {object} string "Bad Request" @Failure 200 {object} string "Concrete Error Msg" @Router /match/ready/{uid} [post]
func (*API) RefuseInvite ¶
RefuseInvite godoc @Summary refuse an invitation @Description refuse an invitation based on the request @Tags match service @Accept json @Produce json @Param x-request-id header string false "Request ID" @Param RefuseInviteReq body RefuseInviteReq true "Refuse Invite Request Body" @Success 200 {object} string "ok" @Failure 400 {object} string "Bad Request" @Failure 200 {object} string "Concrete Error Msg" @Router /match/refuse_invite [post]
func (*API) SetNearbyJoinGroup ¶
SetNearbyJoinGroup godoc @Summary set nearby join group @Description set whether group can be entered from nearby players list @Tags match service @Accept json @Produce json @Param x-request-id header string false "Request ID" @Param SetNearbyJoinGroupReq body SetNearbyJoinGroupReq true "Set Nearby Join Group Request Body" @Success 200 {object} string "ok" @Failure 400 {object} string "Bad Request" @Failure 200 {object} string "Concrete Error Msg" @Router /match/set_nearby_join_group [post]
func (*API) SetRecentJoinGroup ¶
SetRecentJoinGroup godoc @Summary set recent join group @Description set whether group can be entered from recent players list @Tags match service @Accept json @Produce json @Param x-request-id header string false "Request ID" @Param SetRecentJoinGroupReq body SetRecentJoinGroupReq true "Set Recent Join Group Request Body" @Success 200 {object} string "ok" @Failure 400 {object} string "Bad Request" @Failure 200 {object} string "Concrete Error Msg" @Router /match/set_recent_join_group [post]
func (*API) SetVoiceState ¶
SetVoiceState godoc @Summary set voice state @Description set player voice state @Tags match service @Accept json @Produce json @Param x-request-id header string false "Request ID" @Param SetVoiceStateReq body SetVoiceStateReq true "Set Voice State Request Body" @Success 200 {object} string "ok" @Failure 400 {object} string "Bad Request" @Failure 200 {object} string "Concrete Error Msg" @Router /match/set_voice_state [post]
func (*API) StartMatch ¶
StartMatch godoc @Summary start match @Description start to match @Tags match service @Accept json @Produce json @Param x-request-id header string false "Request ID" @Param uid path string true "player uid" @Success 200 {object} string "ok" @Failure 400 {object} string "Bad Request" @Failure 200 {object} string "Concrete Error Msg" @Router /match/start_match/{uid} [post]
func (*API) Unready ¶
Unready godoc @Summary unready @Description unready @Tags match service @Accept json @Produce json @Param x-request-id header string false "Request ID" @Param uid path string true "player uid" @Success 200 {object} string "ok" @Failure 400 {object} string "Bad Request" @Failure 200 {object} string "Concrete Error Msg" @Router /match/unready/{uid} [post]
func (*API) UploadPlayerAttr ¶
UploadPlayerAttrReq godoc @Summary upload player attr @Description upload player attr @Tags match service @Accept json @Produce json @Param x-request-id header string false "Request ID" @Param UploadPlayerAttrReq body UploadPlayerAttrReq true "Upload Player Attr Request Body" @Success 200 {object} string "ok" @Failure 400 {object} string "Bad Request" @Failure 200 {object} string "Concrete Error Msg" @Router /match/upload_player_attr [post]
type AcceptInviteReq ¶
type AcceptInviteReq struct { InviterUID string `json:"inviter_uid" binding:"required"` InviteeInfo *pto.PlayerInfo `json:"invitee_info" binding:"required"` GroupID int64 `json:"group_id" binding:"required"` }
type ChangeRoleReq ¶
type CreateGroupRsp ¶
type CreateGroupRsp struct {
GroupID int64 `json:"group_id,omitempty"`
}
type EnterGroupReq ¶
type EnterGroupReq struct { PlayerInfo pto.EnterGroup `json:"player_info" binding:"required"` GroupID int64 `json:"group_id" binding:"required"` }
type ExitGameReq ¶
type ExitGroupReq ¶
type Infra ¶
Infra is the infrastructure for the http api.
func NewInfra ¶
func NewInfra( sc config.Configer[config.ServerConfig], mc config.Configer[config.MatchConfig], ) *Infra
NewInfra creates a new Infra for the http api.
type KickPlayerReq ¶
type RefuseInviteReq ¶
type SetNearbyJoinGroupReq ¶
type SetRecentJoinGroupReq ¶
type SetVoiceStateReq ¶
type SetVoiceStateReq struct { UID string `json:"uid" binding:"required"` State entry.PlayerVoiceState `json:"state" binding:"gte=0,lte=1"` }
type UploadPlayerAttrReq ¶
type UploadPlayerAttrReq struct { UID string `json:"uid" binding:"required"` pto.UploadPlayerAttr }