Documentation ¶
Index ¶
- func RegisterRoutes(r *gin.RouterGroup, service *SessionService)
- type CreateSessionRequest
- type CreateSessionResponse
- type PlayerLiveData
- type Session
- type SessionService
- func (s *SessionService) Create(req CreateSessionRequest) (int, error)
- func (s *SessionService) GetById(id int) (*Session, error)
- func (s *SessionService) GetCDData(id int) (*models.CDGameData, error)
- func (s *SessionService) GetGameData(id int) (*models.GameData, error)
- func (s *SessionService) UpdateGameData(data UpdateGameDataRequest) error
- func (s *SessionService) UpdateStatus(data UpdateStatusRequest) error
- type UpdateGameDataRequest
- type UpdateStatusRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterRoutes ¶
func RegisterRoutes(r *gin.RouterGroup, service *SessionService)
Types ¶
type CreateSessionRequest ¶
type CreateSessionResponse ¶
type CreateSessionResponse struct {
Id int `json:"id"`
}
type PlayerLiveData ¶
type PlayerLiveData struct { AuthId string `json:"auth_id"` AuthType models.AuthType `json:"auth_type"` Name string `json:"name"` Perk models.Perk `json:"perk"` Level int `json:"level"` Prestige int `json:"prestige"` Health int `json:"health"` Armor int `json:"armor"` IsSpectator bool `json:"is_spectator"` }
type Session ¶
type Session struct { Id int `json:"id"` ServerId int `json:"server_id"` MapId int `json:"map_id"` Mode models.GameMode `json:"mode"` Length int `json:"length"` Difficulty models.GameDifficulty `json:"diff"` Status models.GameStatus `json:"status"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` StartedAt *time.Time `json:"started_at"` CompletedAt *time.Time `json:"completed_at"` }
type SessionService ¶
type SessionService struct {
// contains filtered or unexported fields
}
func NewSessionService ¶
func NewSessionService(db *sql.DB) *SessionService
func (*SessionService) Create ¶
func (s *SessionService) Create(req CreateSessionRequest) (int, error)
func (*SessionService) GetCDData ¶
func (s *SessionService) GetCDData(id int) (*models.CDGameData, error)
func (*SessionService) GetGameData ¶
func (s *SessionService) GetGameData(id int) (*models.GameData, error)
func (*SessionService) UpdateGameData ¶
func (s *SessionService) UpdateGameData(data UpdateGameDataRequest) error
func (*SessionService) UpdateStatus ¶
func (s *SessionService) UpdateStatus(data UpdateStatusRequest) error
type UpdateGameDataRequest ¶
type UpdateGameDataRequest struct { SessionId int `json:"session_id"` GameData models.GameData `json:"game_data"` CDData *models.CDGameData `json:"cd_data"` Players []PlayerLiveData `json:"players"` }
type UpdateStatusRequest ¶
Click to show internal directories.
Click to hide internal directories.