Documentation
¶
Index ¶
- Constants
- func CheckLoggedIn(w http.ResponseWriter, r *http.Request)
- func CheckUserCanEdit(w http.ResponseWriter, r *http.Request)
- func CreateMatch(w http.ResponseWriter, r *http.Request)
- func CreateServer(w http.ResponseWriter, r *http.Request)
- func CreateTeam(w http.ResponseWriter, r *http.Request)
- func DeleteServer(w http.ResponseWriter, r *http.Request)
- func DeleteTeam(w http.ResponseWriter, r *http.Request)
- func EditServer(w http.ResponseWriter, r *http.Request)
- func EditTeam(w http.ResponseWriter, r *http.Request)
- func GetMatchInfo(w http.ResponseWriter, r *http.Request)
- func GetMatches(w http.ResponseWriter, r *http.Request)
- func GetMetrics(w http.ResponseWriter, r *http.Request)
- func GetPlayerStatInfo(w http.ResponseWriter, r *http.Request)
- func GetRecentMatches(w http.ResponseWriter, r *http.Request)
- func GetServerInfo(w http.ResponseWriter, r *http.Request)
- func GetServerList(w http.ResponseWriter, r *http.Request)
- func GetStatusString(w http.ResponseWriter, r *http.Request)
- func GetSteamName(w http.ResponseWriter, r *http.Request)
- func GetTeamInfo(w http.ResponseWriter, r *http.Request)
- func GetTeamList(w http.ResponseWriter, r *http.Request)
- func GetUserInfo(w http.ResponseWriter, r *http.Request)
- func GetVersion(w http.ResponseWriter, r *http.Request)
- func MatchAPICheck(m *db.MatchData, r *http.Request) error
- func MatchAddUserHandler(w http.ResponseWriter, r *http.Request)
- func MatchCancelHandler(w http.ResponseWriter, r *http.Request)
- func MatchConfigHandler(w http.ResponseWriter, r *http.Request)
- func MatchDemoUploadHandler(w http.ResponseWriter, r *http.Request)
- func MatchFinishHandler(w http.ResponseWriter, r *http.Request)
- func MatchListBackupsHandler(w http.ResponseWriter, r *http.Request)
- func MatchLoadBackupsHandler(w http.ResponseWriter, r *http.Request)
- func MatchMapFinishHandler(w http.ResponseWriter, r *http.Request)
- func MatchMapPlayerUpdateHandler(w http.ResponseWriter, r *http.Request)
- func MatchMapStartHandler(w http.ResponseWriter, r *http.Request)
- func MatchMapUpdateHandler(w http.ResponseWriter, r *http.Request)
- func MatchPauseHandler(w http.ResponseWriter, r *http.Request)
- func MatchRconHandler(w http.ResponseWriter, r *http.Request)
- func MatchUnpauseHandler(w http.ResponseWriter, r *http.Request)
- func MatchVetoUpdateHandler(w http.ResponseWriter, r *http.Request)
- type APIGameServerData
- type APIMapStatsData
- type APIMatchData
- type APIPlayerStatsData
- type APITeamData
- type APIUserData
- type BackupListJSON
- type CheckLoggedInJSON
- type GetVersionJSON
Constants ¶
const (
// VERSION get5-web-go Version
VERSION = "0.1.1"
)
Variables ¶
This section is empty.
Functions ¶
func CheckLoggedIn ¶
func CheckLoggedIn(w http.ResponseWriter, r *http.Request)
CheckLoggedIn handler for /api/v1/CheckLoggedIn API.
func CheckUserCanEdit ¶
func CheckUserCanEdit(w http.ResponseWriter, r *http.Request)
func CreateMatch ¶
func CreateMatch(w http.ResponseWriter, r *http.Request)
CreateMatch Registers match info
func CreateServer ¶
func CreateServer(w http.ResponseWriter, r *http.Request)
CreateServer Register server to DB
func CreateTeam ¶
func CreateTeam(w http.ResponseWriter, r *http.Request)
CreateTeam Registers team info to DB
func DeleteServer ¶
func DeleteServer(w http.ResponseWriter, r *http.Request)
DeleteServer Deletes Server information
func EditServer ¶
func EditServer(w http.ResponseWriter, r *http.Request)
EditServer Edits Server information
func EditTeam ¶
func EditTeam(w http.ResponseWriter, r *http.Request)
EditTeam Edits team information
func GetMatchInfo ¶
func GetMatchInfo(w http.ResponseWriter, r *http.Request)
GetMatchInfo Gets match info by ID
func GetMatches ¶
func GetMatches(w http.ResponseWriter, r *http.Request)
func GetMetrics ¶
func GetMetrics(w http.ResponseWriter, r *http.Request)
func GetPlayerStatInfo ¶
func GetPlayerStatInfo(w http.ResponseWriter, r *http.Request)
func GetRecentMatches ¶
func GetRecentMatches(w http.ResponseWriter, r *http.Request)
func GetServerInfo ¶
func GetServerInfo(w http.ResponseWriter, r *http.Request)
func GetServerList ¶
func GetServerList(w http.ResponseWriter, r *http.Request)
GetServerList Returns registered public server and owned list in JSON
func GetStatusString ¶
func GetStatusString(w http.ResponseWriter, r *http.Request)
func GetSteamName ¶
func GetSteamName(w http.ResponseWriter, r *http.Request)
GetSteamName Get Steam Profile name by SteamWebAPI
func GetTeamInfo ¶
func GetTeamInfo(w http.ResponseWriter, r *http.Request)
func GetTeamList ¶
func GetTeamList(w http.ResponseWriter, r *http.Request)
GetTeamList Returns registered team list in JSON.
func GetUserInfo ¶
func GetUserInfo(w http.ResponseWriter, r *http.Request)
func GetVersion ¶
func GetVersion(w http.ResponseWriter, r *http.Request)
GetVersion handler for /api/v1/GetVersion API.
func MatchAPICheck ¶
MatchAPICheck Checks if API is available or not
func MatchAddUserHandler ¶
func MatchAddUserHandler(w http.ResponseWriter, r *http.Request)
MatchAddUserHandler Handler for /api/v1/match/{matchID}/adduser API.
func MatchCancelHandler ¶
func MatchCancelHandler(w http.ResponseWriter, r *http.Request)
MatchCancelHandler Handler for /api/v1/match/{matchID}/cancel API.
func MatchConfigHandler ¶
func MatchConfigHandler(w http.ResponseWriter, r *http.Request)
MatchConfigHandler Handler for /api/v1/match/{matchID}/config API.
func MatchDemoUploadHandler ¶
func MatchDemoUploadHandler(w http.ResponseWriter, r *http.Request)
MatchDemoUploadHandler Handler for /api/v1/match/{matchID}/map/{mapNumber}/demo API. // TODO
func MatchFinishHandler ¶
func MatchFinishHandler(w http.ResponseWriter, r *http.Request)
MatchFinishHandler Handler for /api/v1/match/{matchID}/finish API.
func MatchListBackupsHandler ¶
func MatchListBackupsHandler(w http.ResponseWriter, r *http.Request)
MatchListBackupsHandler Handler for /api/v1/match/{matchID}/backup API(GET).
func MatchLoadBackupsHandler ¶
func MatchLoadBackupsHandler(w http.ResponseWriter, r *http.Request)
MatchLoadBackupsHandler Handler for /api/v1/match/{matchID}/backup API(POST).
func MatchMapFinishHandler ¶
func MatchMapFinishHandler(w http.ResponseWriter, r *http.Request)
MatchMapFinishHandler Handler for /api/v1/match/{matchID}/map/{mapNumber}/finish API.
func MatchMapPlayerUpdateHandler ¶
func MatchMapPlayerUpdateHandler(w http.ResponseWriter, r *http.Request)
MatchMapPlayerUpdateHandler Handler for /api/v1/match/{matchID}/map/{mapNumber}/player/{steamid64}/update API.
func MatchMapStartHandler ¶
func MatchMapStartHandler(w http.ResponseWriter, r *http.Request)
MatchMapStartHandler Handler for /api/v1/match/{matchID}/map/{mapNumber}/start API.
func MatchMapUpdateHandler ¶
func MatchMapUpdateHandler(w http.ResponseWriter, r *http.Request)
MatchMapUpdateHandler Handler for /api/v1/match/{matchID}/map/{mapNumber}/update API.
func MatchPauseHandler ¶
func MatchPauseHandler(w http.ResponseWriter, r *http.Request)
MatchPauseHandler Handler for /api/v1/match/{matchID}/pause API.
func MatchRconHandler ¶
func MatchRconHandler(w http.ResponseWriter, r *http.Request)
MatchRconHandler Handler for /api/v1/match/{matchID}/rcon API.
func MatchUnpauseHandler ¶
func MatchUnpauseHandler(w http.ResponseWriter, r *http.Request)
MatchUnpauseHandler Handler for /api/v1/match/{matchID}/unpause API.
func MatchVetoUpdateHandler ¶
func MatchVetoUpdateHandler(w http.ResponseWriter, r *http.Request)
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:-" json:"servers"`
Teams []APITeamData `gorm:"foreignkey:-" json:"teams"`
Matches []APIMatchData `gorm:"foreignkey:-" 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
type CheckLoggedInJSON ¶
type CheckLoggedInJSON struct {
IsLoggedIn bool `json:"isLoggedIn"`
IsAdmin bool `json:"isAdmin"`
SteamID string `json:"steamid"`
UserID int `json:"userid"`
}
CheckLoggedInJSON Struct type for /api/v1/CheckLoggedIn API.
type GetVersionJSON ¶
type GetVersionJSON struct {
Version string `json:"version"`
}
GetVersionJSON Struct type for /api/v1/GetVersion API Response.