Documentation ¶
Index ¶
- Constants
- Variables
- type Availability
- type AvailabilityCore
- type CompetitionWeek
- type DataProblem
- type Game
- type GameCore
- type GameCreationInformation
- type GameDAO
- type GameResult
- type GameTime
- type League
- type LeagueCore
- type LeagueDAO
- type LeagueOfLegendsDAO
- type LeaguePermissionsCore
- type LoLChampionStats
- type LoLMatchInformation
- type LoLMatchPlayerStats
- type LoLMatchTeamStats
- type LoLPlayer
- type LoLPlayerCore
- type LoLPlayerStats
- type LoLPlayerStub
- type LoLTeamStats
- type LoLTeamStub
- type LoLTeamWithPlayersCore
- type LoLTeamWithRosters
- type LoginRequest
- type Markdown
- type Player
- type PlayerCore
- type SchedulingParameters
- type SortedGames
- type TeamCore
- type TeamDAO
- type TeamDisplay
- type TeamManager
- type TeamPermissions
- type TeamPermissionsCore
- type TeamWithManagers
- type TeamWithPlayers
- type TeamWithPlayersCore
- type TeamWithRosters
- type User
- type UserAuthenticationDTO
- type UserCreationInformation
- type UserDAO
- type UserWithPermissions
- type ValidateFunc
- type WeeklyAvailability
- type WeeklyAvailabilityCore
Constants ¶
View Source
const ( MaxTagLength = 5 MaxNameLength = 50 MaxDescriptionLength = 500 MaxMdLength = 50000 MaxPasswordLength = 64 MinInformationLength = 2 MinPasswordLength = 8 )
View Source
const ( NameTooLong = "Name too long" NameTooShort = "Name too short" TagTooLong = "Tag too long" GameIdentifierTooLong = "Game identifier too long" GameIdentifierTooShort = "Game identifier too short" TagTooShort = "Tag too short" PasswordTooLong = "Password too long" PasswordTooShort = "Password too short" DescriptionTooLong = "Description too long" MarkdownTooLong = "Markdown too long" LeagueNameInUse = "League name already in use" EmailInUse = "Email in use" EmailMalformed = "Email is malformed" InvalidGame = "Game string not valid" LeaguePermissionsWrong = "League cannot be invisible but have public join enabled" TimeOutOfOrder = "Start time before end time" PeriodOutOfOrder = "League starts before signup ends" AdminLackingPermissions = "Administrator must have all permissions enabled" TeamsMustBeDifferent = "The two teams in game must be different" TeamInGameDoesNotExist = "A team in this game does not exist in this league" PlayerGameIdentifierInUse = "Player game Identifier already in use" ExternalIdentifierInUse = "An entity in this league already has this external id" GameConflict = "A team in this game already has a game starting at this time" GameNotDuringLeague = "This game start time is not during the league competition period" AvailabilityStartNotDuringLeague = "This availability start time is not during the league competition period" AvailabilityEndNotDuringLeague = "This availability end time is not during the league competition period" GameDoesNotContainTeams = "The teams in this game report are not in this game" AvailabilityOutOfOrder = "Availability start time must be before end time" InvalidWeekday = "Weekday must be one of 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'" InvalidTimezone = "Timezone offset cannot be more than 24 hours" InvalidHour = "Hour must be between 0 and 23 inclusive" InvalidMinute = "Minute must be between 0 and 59 inclusive" InvalidWeeklyAvailabilityDuration = "Weekly availability duration can not be longer than a week" TournamentTypeNotSupported = "The specified tournament type is not supported" AvailabilitiesNotDuringLeague = "New league times would result in an availability outside the league competition period" GamesNotDuringLeague = "New league times would result in a game scheduled outside the league competition period" )
Variables ¶
View Source
var ValidGameStrings = [...]string{
"genericsport",
"basketball",
"curling",
"football",
"hockey",
"rugby",
"soccer",
"volleyball",
"waterpolo",
"genericesport",
"csgo",
"leagueoflegends",
"overwatch",
}
Functions ¶
This section is empty.
Types ¶
type Availability ¶
type AvailabilityCore ¶
type CompetitionWeek ¶
type DataProblem ¶
type DataProblem string
type Game ¶
type Game struct { GameId int `json:"gameId"` GameTime int `json:"gameTime"` Team1 TeamDisplay `json:"team1"` Team2 TeamDisplay `json:"team2"` WinnerId int `json:"winnerId"` LoserId int `json:"loserId"` ScoreTeam1 int `json:"scoreTeam1"` ScoreTeam2 int `json:"scoreTeam2"` Complete bool `json:"complete"` }
type GameCore ¶
type GameCore struct { GameTime int `json:"gameTime"` Team1 TeamDisplay `json:"team1"` Team2 TeamDisplay `json:"team2"` }
type GameCreationInformation ¶
type GameCreationInformation struct { Team1Id int `json:"team1Id"` Team2Id int `json:"team2Id"` GameTime int `json:"gameTime"` }
func (GameCreationInformation) ValidateReschedule ¶
type GameDAO ¶
type GameDAO interface { // Modify Games CreateGame(leagueId int, gameInformation GameCreationInformation) (int, error) ReportGame(gameId int, gameResult GameResult) error ReportGameByExternalId(externalId string, gameResult GameResult) (int, int, error) DeleteGame(gameId int) error RescheduleGame(gameId, gameTime int) error AddExternalId(gameId int, externalId string) error // Get Game Information GetAllGamesInLeague(leagueId int) ([]*Game, error) GetSortedGames(leagueId, teamId, limit int) (*SortedGames, error) GetGamesByWeek(leagueId, timeZone int) ([]*CompetitionWeek, error) GetGameInformation(gameId int) (*Game, error) GetGameInformationFromExternalId(externalId string) (*Game, error) DoesGameExistInLeague(leagueId, gameId int) (bool, error) // Get Information for Games Management DoesExistConflict(team1Id, team2Id, gameTime int) (bool, error) HasReportResultPermissions(leagueId, gameId, userId int) (bool, error) }
type GameResult ¶
type GameResult struct { WinnerId int `json:"winnerId"` LoserId int `json:"loserId"` ScoreTeam1 int `json:"scoreTeam1"` ScoreTeam2 int `json:"scoreTeam2"` }
func (*GameResult) ValidateByExternalId ¶
type League ¶
type League struct { LeagueId int `json:"leagueId"` Name string `json:"name"` Description string `json:"description"` Game string `json:"game"` PublicView bool `json:"publicView"` PublicJoin bool `json:"publicJoin"` SignupStart int `json:"signupStart"` SignupEnd int `json:"signupEnd"` LeagueStart int `json:"leagueStart"` LeagueEnd int `json:"leagueEnd"` }
type LeagueCore ¶
type LeagueCore struct { Name string `json:"name"` Description string `json:"description"` Game string `json:"game"` PublicView bool `json:"publicView"` PublicJoin bool `json:"publicJoin"` SignupStart int `json:"signupStart"` SignupEnd int `json:"signupEnd"` LeagueStart int `json:"leagueStart"` LeagueEnd int `json:"leagueEnd"` }
func (*LeagueCore) ValidateEdit ¶
func (*LeagueCore) ValidateNew ¶
func (league *LeagueCore) ValidateNew(leagueDao LeagueDAO) (bool, string, error)
type LeagueDAO ¶
type LeagueDAO interface { // Modify League CreateLeague(userId int, leagueInfo LeagueCore) (int, error) UpdateLeague(leagueId int, leagueInfo LeagueCore) error JoinLeague(leagueId, userId int) error // Permissions SetLeaguePermissions(leagueId, userId int, permissions LeaguePermissionsCore) error //GetLeaguePermissions(leagueId, userId int) (*LeaguePermissionsDTO, error) GetTeamManagerInformation(leagueId int) ([]*TeamWithManagers, error) IsLeagueViewable(leagueId, userId int) (bool, error) CanJoinLeague(leagueId, userId int) (bool, error) // Get Information About Leagues DoesLeagueExist(leagueId int) (bool, error) GetLeagueInformation(leagueId int) (*League, error) IsNameInUse(leagueId int, name string) (bool, error) GetPublicLeagueList() ([]*League, error) // Markdown GetMarkdownFile(leagueId int) (string, error) SetMarkdownFile(leagueId int, fileName string) error // Availabilities AddAvailability(leagueId int, availability AvailabilityCore) (int, error) GetAvailabilities(leagueId int) ([]*Availability, error) DeleteAvailability(availabilityId int) error AddWeeklyAvailability(leagueId int, availability WeeklyAvailabilityCore) (int, error) GetWeeklyAvailabilities(leagueId int) ([]*WeeklyAvailability, error) EditWeeklyAvailability(availabilityId int, availability WeeklyAvailabilityCore) error DeleteWeeklyAvailability(availabilityId int) error DoesAvailabilityExistInLeague(leagueId, availabilityId int) (bool, error) }
type LeagueOfLegendsDAO ¶
type LeagueOfLegendsDAO interface { CreateLoLPlayer(leagueId, teamId int, externalId string, playerInfo LoLPlayerCore) (int, error) CreateLoLTeamWithPlayers(leagueId, userId int, teamInfo TeamCore, players []*LoLPlayerCore, iconSmall, iconLarge string) (int, error) UpdateLoLPlayer(playerId int, externalId string, playerInfo LoLPlayerCore) error GetLoLTeamStub(teamId int) (*LoLTeamStub, error) GetAllLoLTeamStubInLeague(leagueId int) ([]*LoLTeamStub, error) ReportEndGameStats(leagueId, gameId int, match *LoLMatchInformation) error GetPlayerStats(leagueId int) ([]*LoLPlayerStats, error) GetTeamStats(leagueId int) ([]*LoLTeamStats, error) GetChampionStats(leagueId int) ([]*LoLChampionStats, error) RegisterTournamentProvider(leagueId, providerId, tournamentId int) error LeagueHasRegisteredTournament(leagueId int) (bool, error) GetTournamentId(leagueId int) (int, error) HasTournamentCode(gameId int) (bool, error) GetTournamentCode(gameId int) (string, error) CreateTournamentCode(gameId int, tournamentCode string) error }
type LeaguePermissionsCore ¶
type LoLChampionStats ¶
type LoLMatchInformation ¶
type LoLMatchInformation struct { GameId string `json:"gameId"` Duration float64 `json:"duration"` Timestamp int `json:"timestamp"` Team1Id int `json:"team1Id"` Team2Id int `json:"team2Id"` WinningTeamId int `json:"winningTeamId"` LosingTeamId int `json:"losingTeamId"` BannedChampions []string `json:"bannedChampions"` WinningChampions []string `json:"winningChampions"` LosingChampions []string `json:"losingChampions"` WinningTeamSummonerIds []string `json:"winningTeamSummonerIds"` LosingTeamSummonerIds []string `json:"losingTeamSummonerIds"` WinningTeamStats LoLMatchTeamStats `json:"winningTeamStats"` LosingTeamStats LoLMatchTeamStats `json:"losingTeamStats"` PlayerStats []LoLMatchPlayerStats `json:"playerStats"` }
type LoLMatchPlayerStats ¶
type LoLMatchPlayerStats struct { Id string `json:"id"` Name string `json:"name"` ChampionPicked string `json:"championPicked"` Gold float64 `json:"gold"` Cs float64 `json:"cs"` Damage float64 `json:"damage"` Kills float64 `json:"kills"` Deaths float64 `json:"deaths"` Assists float64 `json:"assists"` Wards float64 `json:"wards"` Win bool `json:"win"` }
type LoLMatchTeamStats ¶
type LoLPlayerCore ¶
type LoLPlayerCore struct { GameIdentifier string `json:"gameIdentifier"` MainRoster bool `json:"mainRoster"` Position string `json:"position"` ExternalId string `json:"externalId"` }
func (*LoLPlayerCore) ValidateEdit ¶
func (player *LoLPlayerCore) ValidateEdit(leagueId, teamId, playerId int, leagueOfLegendsDAO LeagueOfLegendsDAO) (bool, string, error)
func (*LoLPlayerCore) ValidateNew ¶
func (player *LoLPlayerCore) ValidateNew(leagueId, teamId int, leagueOfLegendsDAO LeagueOfLegendsDAO) (bool, string, error)
type LoLPlayerStats ¶
type LoLPlayerStats struct { Id string `json:"id"` Name string `json:"name"` TeamId int `json:"teamId"` AverageDuration float64 `json:"averageDuration"` GoldPerMinute float64 `json:"goldPerMinute"` CsPerMinute float64 `json:"csPerMinute"` DamagePerMinute float64 `json:"damagePerMinute"` AverageKills float64 `json:"averageKills"` AverageDeaths float64 `json:"averageDeaths"` AverageAssists float64 `json:"averageAssists"` AverageKda float64 `json:"averageKda"` AverageWards float64 `json:"averageWards"` }
type LoLPlayerStub ¶
type LoLTeamStats ¶
type LoLTeamStats struct { Id string `json:"id"` AverageDuration float64 `json:"averageDuration"` NumberFirstBloods int `json:"numberFirstBloods"` NumberFirstTurrets int `json:"numberFirstTurrets"` AverageKda float64 `json:"averageKda"` AverageWards float64 `json:"averageWards"` AverageActionScore float64 `json:"averageActionScore"` GoldPerMinute float64 `json:"goldPerMinute"` CsPerMinute float64 `json:"csPerMinute"` }
type LoLTeamStub ¶
type LoLTeamStub struct { TeamId int Name string Description string Tag string IconSmall string IconLarge string Wins int Losses int MainRoster []*LoLPlayerStub SubstituteRoster []*LoLPlayerStub }
type LoLTeamWithPlayersCore ¶
type LoLTeamWithPlayersCore struct { Team TeamCore `json:"team"` Icon string `json:"icon"` Players []*LoLPlayerCore `json:"players"` }
type LoLTeamWithRosters ¶
type LoLTeamWithRosters struct { TeamId int `json:"teamId"` Name string `json:"name"` Description string `json:"description"` Tag string `json:"tag"` IconSmall string `json:"iconSmall"` IconLarge string `json:"iconLarge"` Wins int `json:"wins"` Losses int `json:"losses"` MainRoster []*LoLPlayer `json:"mainRoster"` SubstituteRoster []*LoLPlayer `json:"substituteRoster"` }
type LoginRequest ¶
type PlayerCore ¶
type PlayerCore struct { Name string `json:"name"` GameIdentifier string `json:"gameIdentifier"` MainRoster bool `json:"mainRoster"` }
func (*PlayerCore) ValidateEdit ¶
func (*PlayerCore) ValidateNew ¶
type SchedulingParameters ¶
type SortedGames ¶
type TeamCore ¶
type TeamCore struct { Name string `json:"name"` Description string `json:"description"` Tag string `json:"tag"` }
func (*TeamCore) ValidateEdit ¶
type TeamDAO ¶
type TeamDAO interface { // Teams CreateTeam(leagueId, userId int, teamInfo TeamCore) (int, error) CreateTeamWithIcon(leagueId, userId int, teamInfo TeamCore, iconSmall, iconLarge string) (int, error) CreateTeamWithPlayers(leagueId, userId int, teamInfo TeamCore, players []PlayerCore, iconSmall, iconLarge string) (int, error) DeleteTeam(teamId int) error UpdateTeam(teamId int, teamInformation TeamCore) error UpdateTeamIcon(teamId int, small, large string) error GetTeamInformation(teamId int) (*TeamWithPlayers, error) GetTeamWithRosters(teamId int) (*TeamWithRosters, error) GetAllTeamsInLeague(leagueId int) ([]*TeamWithPlayers, error) GetAllTeamsInLeagueWithRosters(leagueId int) ([]*TeamWithRosters, error) GetAllTeamDisplaysInLeague(leagueId int) ([]*TeamDisplay, error) // Players CreatePlayer(leagueId, teamId int, playerInfo PlayerCore) (int, error) DeletePlayer(playerId int) error UpdatePlayer(playerId int, playerInfo PlayerCore) error // Get Information For Team and Player Management GetTeamPermissions(teamId, userId int) (*TeamPermissionsCore, error) IsInfoInUse(leagueId, teamId int, name, tag string) (bool, string, error) DoesTeamExistInLeague(leagueId, teamId int) (bool, error) IsTeamActive(leagueId, teamId int) (bool, error) DoesPlayerExist(leagueId, teamId, playerId int) (bool, error) // Managers ChangeManagerPermissions(teamId, userId int, teamPermissionInformation TeamPermissionsCore) error }
type TeamDisplay ¶
type TeamManager ¶
type TeamPermissions ¶
type TeamPermissionsCore ¶
type TeamWithManagers ¶
type TeamWithManagers struct { TeamId int `json:"teamId"` Name string `json:"name"` Tag string `json:"tag"` IconSmall string `json:"iconSmall"` Managers []*TeamManager `json:"managers"` }
type TeamWithPlayers ¶
type TeamWithPlayers struct { TeamId int `json:"teamId"` Name string `json:"name"` Description string `json:"description"` Tag string `json:"tag"` IconSmall string `json:"iconSmall"` IconLarge string `json:"iconLarge"` Wins int `json:"wins"` Losses int `json:"losses"` Players []*Player `json:"players"` }
type TeamWithPlayersCore ¶
type TeamWithPlayersCore struct { Team TeamCore `json:"team"` Icon string `json:"icon"` Players []PlayerCore `json:"players"` }
type TeamWithRosters ¶
type TeamWithRosters struct { TeamId int `json:"teamId"` Name string `json:"name"` Description string `json:"description"` Tag string `json:"tag"` IconSmall string `json:"iconSmall"` IconLarge string `json:"iconLarge"` Wins int `json:"wins"` Losses int `json:"losses"` MainRoster []*Player `json:"mainRoster"` SubstituteRoster []*Player `json:"substituteRoster"` }
type UserAuthenticationDTO ¶
type UserCreationInformation ¶
type UserDAO ¶
type UserDAO interface { CreateUser(email, salt, hash string) (int, error) IsEmailInUse(email string) (bool, error) GetAuthenticationInformation(email string) (*UserAuthenticationDTO, error) GetUserProfile(userId int) (*User, error) GetUserWithPermissions(leagueId, userId int) (*UserWithPermissions, error) }
type UserWithPermissions ¶
type UserWithPermissions struct { UserId int `json:"userId"` Email string `json:"email"` LeaguePermissions *LeaguePermissionsCore `json:"leaguePermissions"` TeamPermissions []*TeamPermissions `json:"teamPermissions"` }
type ValidateFunc ¶
Each incoming data structure should implement this to check data correctness
type WeeklyAvailability ¶
type WeeklyAvailabilityCore ¶
type WeeklyAvailabilityCore struct { StartTime int `json:"startTime"` EndTime int `json:"endTime"` Weekday string `json:"weekday"` Timezone int `json:"timezone"` Hour int `json:"hour"` Minute int `json:"minute"` Duration int `json:"duration"` }
func (*WeeklyAvailabilityCore) ValidateEdit ¶
func (*WeeklyAvailabilityCore) ValidateNew ¶
Click to show internal directories.
Click to hide internal directories.