Documentation ¶
Index ¶
- Constants
- Variables
- func CheckLoggedIn(c *gin.Context)
- func CheckUserCanEdit(c *gin.Context)
- func CreateMatch(c *gin.Context)
- func CreateServer(c *gin.Context)
- func CreateTeam(c *gin.Context)
- func DeleteServer(c *gin.Context)
- func DeleteTeam(c *gin.Context)
- func EditServer(c *gin.Context)
- func EditTeam(c *gin.Context)
- func GetMapList(c *gin.Context)
- func GetMatchInfo(c *gin.Context)
- func GetMatches(c *gin.Context)
- func GetMetrics(c *gin.Context)
- func GetPlayerStatInfo(c *gin.Context)
- func GetRecentMatches(c *gin.Context)
- func GetServerInfo(c *gin.Context)
- func GetServerList(c *gin.Context)
- func GetStatusString(c *gin.Context)
- func GetSteamName(c *gin.Context)
- func GetTeamInfo(c *gin.Context)
- func GetTeamList(c *gin.Context)
- func GetUserInfo(c *gin.Context)
- func GetVersion(c *gin.Context)
- func MatchAPICheck(m *db.MatchData, r *http.Request) error
- func MatchAddUserHandler(c *gin.Context)
- func MatchCancelHandler(c *gin.Context)
- func MatchConfigHandler(c *gin.Context)
- func MatchDemoUploadHandler(c *gin.Context)
- func MatchFinishHandler(c *gin.Context)
- func MatchListBackupsHandler(c *gin.Context)
- func MatchLoadBackupsHandler(c *gin.Context)
- func MatchMapFinishHandler(c *gin.Context)
- func MatchMapPlayerUpdateHandler(c *gin.Context)
- func MatchMapStartHandler(c *gin.Context)
- func MatchMapUpdateHandler(c *gin.Context)
- func MatchPauseHandler(c *gin.Context)
- func MatchRconHandler(c *gin.Context)
- func MatchUnpauseHandler(c *gin.Context)
- func MatchVetoUpdateHandler(c *gin.Context)
- type APIGameServerData
- type APIMapStatsData
- type APIMatchData
- type APIPlayerStatsData
- type APITeamData
- type APIUserData
- type BackupListJSON
Constants ¶
const (
// VERSION get5-web-go Version
VERSION = "0.1.2"
)
Variables ¶
var ( ActiveMapPool []string ReserveMapPool []string )
Functions ¶
func CheckLoggedIn ¶
CheckLoggedIn handler for /api/v1/CheckLoggedIn API.
func CheckUserCanEdit ¶
func GetMapList ¶ added in v0.1.2
GetMapList handler for /api/v1/GetMapList API.
func GetMatches ¶
func GetMetrics ¶
func GetPlayerStatInfo ¶
func GetRecentMatches ¶
func GetServerInfo ¶
func GetServerList ¶
GetServerList Returns registered public server and owned list in JSON
func GetStatusString ¶
func GetSteamName ¶
GetSteamName Get Steam Profile name by SteamWebAPI
func GetTeamInfo ¶
func GetTeamList ¶
GetTeamList Returns registered team list in JSON.
func GetUserInfo ¶
func MatchAPICheck ¶
MatchAPICheck Checks if API is available or not
func MatchAddUserHandler ¶
MatchAddUserHandler Handler for /api/v1/match/{matchID}/adduser API.
func MatchCancelHandler ¶
MatchCancelHandler Handler for /api/v1/match/{matchID}/cancel API.
func MatchConfigHandler ¶
MatchConfigHandler Handler for /api/v1/match/{matchID}/config API.
func MatchDemoUploadHandler ¶
MatchDemoUploadHandler Handler for /api/v1/match/{matchID}/map/{mapNumber}/demo API. // TODO
func MatchFinishHandler ¶
MatchFinishHandler Handler for /api/v1/match/{matchID}/finish API.
func MatchListBackupsHandler ¶
MatchListBackupsHandler Handler for /api/v1/match/{matchID}/backup API(GET).
func MatchLoadBackupsHandler ¶
MatchLoadBackupsHandler Handler for /api/v1/match/{matchID}/backup API(POST).
func MatchMapFinishHandler ¶
MatchMapFinishHandler Handler for /api/v1/match/{matchID}/map/{mapNumber}/finish API.
func MatchMapPlayerUpdateHandler ¶
MatchMapPlayerUpdateHandler Handler for /api/v1/match/{matchID}/map/{mapNumber}/player/{steamid64}/update API.
func MatchMapStartHandler ¶
MatchMapStartHandler Handler for /api/v1/match/{matchID}/map/{mapNumber}/start API.
func MatchMapUpdateHandler ¶
MatchMapUpdateHandler Handler for /api/v1/match/{matchID}/map/{mapNumber}/update API.
func MatchPauseHandler ¶
MatchPauseHandler Handler for /api/v1/match/{matchID}/pause API.
func MatchRconHandler ¶
MatchRconHandler Handler for /api/v1/match/{matchID}/rcon API.
func MatchUnpauseHandler ¶
MatchUnpauseHandler Handler for /api/v1/match/{matchID}/unpause API.
func MatchVetoUpdateHandler ¶
MatchVetoUpdateHandler Handler for /api/v1/match/{matchID}/vetoUpdate API. // TODO
Types ¶
type APIGameServerData ¶
type APIGameServerData struct { ID int `gorm:"primary_key;column:id;AUTO_INCREMENT;NOT NULL" json:"id"` UserID int `gorm:"column:user_id;DEFAULT NULL" json:"user_id"` InUse bool `gorm:"column:in_use;DEFAULT NULL" json:"in_use"` IPString string `gorm:"column:ip_string;DEFAULT NULL" json:"ip_string"` Port int `gorm:"column:port;DEFAULT NULL" json:"port"` Display string `gorm:"column:display_name" json:"display_name"` PublicServer bool `gorm:"column:public_server;DEFAULT NULL" json:"public_server"` }
GameServerData Struct for game_server table.
func (*APIGameServerData) TableName ¶
func (u *APIGameServerData) TableName() string
TableName declairation for GORM
type APIMapStatsData ¶
type APIMapStatsData struct { ID int `gorm:"primary_key" gorm:"column:id" json:"id"` MatchID int `gorm:"column:match_id" gorm:"ForeignKey:match_id" json:"match_id"` MapNumber int `gorm:"column:map_number" json:"map_number"` MapName string `gorm:"column:map_name" json:"map_name"` StartTime sql.NullTime `gorm:"column:start_time" json:"-"` StartTimeJSON time.Time `json:"start_time"` EndTime sql.NullTime `gorm:"column:end_time" json:"-"` EndTimeJSON time.Time `json:"end_time"` Winner int `gorm:"column:winner" json:"winner"` Team1Score int `gorm:"column:team1_score" json:"team1_score"` Team2Score int `gorm:"column:team2_score" json:"team2_score"` }
APIMapStatsData MapStatsData struct for map_stats table.
func (*APIMapStatsData) TableName ¶
func (u *APIMapStatsData) TableName() string
TableName declairation for GORM
type APIMatchData ¶
type APIMatchData struct { ID int `gorm:"primary_key;column:id" json:"id"` UserID int `gorm:"column:user_id" json:"user_id"` Team1 APITeamData `json:"team1"` Team2 APITeamData `json:"team2"` Winner int64 `gorm:"column:winner" json:"winner"` Cancelled bool `gorm:"column:cancelled" json:"cancelled"` StartTime sql.NullTime `gorm:"column:start_time" json:"-"` StartTimeJSON time.Time `json:"start_time"` EndTime sql.NullTime `gorm:"column:end_time" json:"-"` EndTimeJSON time.Time `json:"end_time"` MaxMaps int `gorm:"column:max_maps" json:"max_maps"` Title string `gorm:"column:title" json:"title"` SkipVeto bool `gorm:"column:skip_veto" json:"skip_veto"` VetoMapPool []string `gorm:"column:veto_mappool" json:"veto_mappool"` Team1Score int `gorm:"column:team1_score" json:"team1_score"` Team2Score int `gorm:"column:team2_score" json:"team2_score"` Team1String string `gorm:"column:team1_string" json:"team1_string"` Team2String string `gorm:"column:team2_string" json:"team2_string"` Forfeit bool `gorm:"column:forfeit" json:"forfeit"` MapStats []APIMapStatsData `json:"map_stats"` Server APIGameServerData `json:"server"` User APIUserData `json:"user"` Pending bool `json:"pending"` Live bool `json:"live"` Status string `json:"status"` }
APIMatchData Struct for match table.
func (*APIMatchData) TableName ¶
func (u *APIMatchData) TableName() string
TableName declairation for GORM
type APIPlayerStatsData ¶
type APIPlayerStatsData struct { ID int `gorm:"primary_key;column:id" json:"id"` MatchID int `gorm:"column:match_id" json:"match_id"` MapID int `gorm:"column:map_id" json:"map_id"` TeamID int `gorm:"column:team_id" json:"team_id"` SteamID string `gorm:"column:steam_id;unique" json:"steam_id"` Name string `gorm:"column:name" json:"name"` Kills int `gorm:"column:kills" json:"kills"` Deaths int `gorm:"column:deaths" json:"deaths"` Roundsplayed int `gorm:"column:roundsplayed" json:"roundsplayed"` Assists int `gorm:"column:assists" json:"assists"` FlashbangAssists int `gorm:"column:flashbang_assists" json:"flashbang_assists"` Teamkills int `gorm:"column:teamkills" json:"teamkills"` Suicides int `gorm:"column:suicides" json:"suicides"` HeadshotKills int `gorm:"column:headshot_kills" json:"headshot_kills"` Damage int64 `gorm:"column:damage" json:"damage"` BombPlants int `gorm:"column:bomb_plants" json:"bomb_plants"` BombDefuses int `gorm:"column:bomb_defuses" json:"bomb_defuses"` V1 int `gorm:"column:v1" json:"v1"` V2 int `gorm:"column:v2" json:"v2"` V3 int `gorm:"column:v3" json:"v3"` V4 int `gorm:"column:v4" json:"v4"` V5 int `gorm:"column:v5" json:"v5"` K1 int `gorm:"column:k1" json:"k1"` K2 int `gorm:"column:k2" json:"k2"` K3 int `gorm:"column:k3" json:"k3"` K4 int `gorm:"column:k4" json:"k4"` K5 int `gorm:"column:k5" json:"k5"` FirstdeathCT int `gorm:"column:firstdeath_Ct" json:"firstdeath_Ct"` FirstdeathT int `gorm:"column:firstdeath_t" json:"firstdeath_t"` FirstkillCT int `gorm:"column:firstkill_ct" json:"firstkill_ct"` FirstkillT int `gorm:"column:firstkill_t" json:"firstkill_t"` Rating float64 `json:"rating"` KDR float64 `json:"kdr"` HSP float64 `json:"hsp"` ADR float64 `json:"adr"` FPR float64 `json:"fpr"` }
APIPlayerStatsData Player stats data struct for player_stats table.
func (*APIPlayerStatsData) GetADR ¶
func (p *APIPlayerStatsData) GetADR() float64
GetADR Returns player's ADR(Average Damage per Round).
func (*APIPlayerStatsData) GetFPR ¶
func (p *APIPlayerStatsData) GetFPR() float64
GetFPR Returns player's FPR(Frags Per Round).
func (*APIPlayerStatsData) GetHSP ¶
func (p *APIPlayerStatsData) GetHSP() float64
GetHSP Returns player's HSP(HeadShot Percentage).
func (*APIPlayerStatsData) GetKDR ¶
func (p *APIPlayerStatsData) GetKDR() float64
GetKDR Returns player's KDR(Kill/Deaths Ratio).
func (*APIPlayerStatsData) GetRating ¶
func (p *APIPlayerStatsData) GetRating() float64
GetRating Get player's rating. Average datas are static tho.
func (*APIPlayerStatsData) TableName ¶
func (p *APIPlayerStatsData) TableName() string
TableName declairation for GORM
type APITeamData ¶
type APITeamData struct { ID int `gorm:"primary_key;column:id" json:"id"` UserID int `gorm:"column:user_id" json:"user_id"` Name string `gorm:"column:name" json:"name"` Tag string `gorm:"column:tag" json:"tag"` Flag string `gorm:"column:flag" json:"flag"` Logo string `gorm:"column:logo" json:"logo"` AuthsPickle []byte `gorm:"column:auths" json:"-"` SteamIDs []string `gorm:"-" json:"steamids"` PublicTeam bool `gorm:"column:public_team" json:"public_team"` User APIUserData `gorm:"ASSOCIATION_FOREIGNKEY:user_id" json:"-"` }
TeamData Struct for team table.
func (*APITeamData) GetPlayers ¶
func (t *APITeamData) GetPlayers() ([]string, error)
GetPlayers Gets registered player's steamid64.
func (*APITeamData) TableName ¶
func (t *APITeamData) TableName() string
TableName declairation for GORM
type APIUserData ¶
type APIUserData struct { ID int `gorm:"primary_key;column:id;AUTO_INCREMENT" json:"id"` SteamID string `gorm:"column:steam_id;unique" json:"steam_id"` Name string `gorm:"column:name" json:"name"` Admin bool `gorm:"column:admin" json:"admin"` Servers []*APIGameServerData `gorm:"ForeignKey:UserID" json:"servers"` Teams []*APITeamData `gorm:"ForeignKey:UserID" json:"teams"` Matches []*APIMatchData `gorm:"ForeignKey:UserID" json:"matches"` }
UserData Struct for "user" table.
func (*APIUserData) TableName ¶
func (u *APIUserData) TableName() string
TableName declairation for GORM
type BackupListJSON ¶
type BackupListJSON struct {
Files []string `json:"files"`
}
BackupListJSON Struct type for /api/v1/match/{matchID}/backup