Documentation
¶
Overview ¶
Package models provides the entities used in gonawin app.
Index ¶
- func AccuracyKeyByID(c appengine.Context, id int64) *datastore.Key
- func AddScores(c appengine.Context, tournamentScores []*Score, scores []int64) error
- func AddToTeamInvertedIndex(c appengine.Context, name string, id int64) error
- func AddToTournamentInvertedIndex(c appengine.Context, name string, id int64) error
- func AddToUserInvertedIndex(c appengine.Context, name string, id int64) error
- func DestroyActivities(c appengine.Context, activityIds []int64) error
- func DestroyGroups(c appengine.Context, groupIDs []int64) error
- func DestroyMatches(c appengine.Context, matchIds []int64) error
- func DestroyPredicts(c appengine.Context, predictIds []int64) error
- func GenerateAuthKey() string
- func GetTeamFrequencyForWord(c appengine.Context, word string) (int64, error)
- func GetTeamInvertedIndexes(c appengine.Context, words []string) ([]int64, error)
- func GetTournamentFrequencyForWord(c appengine.Context, word string) (int64, error)
- func GetTournamentInvertedIndexes(c appengine.Context, words []string) ([]int64, error)
- func GetUserFrequencyForWord(c appengine.Context, word string) (int64, error)
- func GetUserInvertedIndexes(c appengine.Context, words []string) ([]int64, error)
- func GetWordFrequencyForTeam(c appengine.Context, Id int64, word string) int64
- func GetWordFrequencyForTournament(c appengine.Context, id int64, word string) int64
- func GetWordFrequencyForUser(c appengine.Context, id int64, word string) int64
- func GroupKeyByID(c appengine.Context, Id int64) *datastore.Key
- func IsTeamAdmin(c appengine.Context, teamID int64, userID int64) bool
- func IsTournamentAdmin(c appengine.Context, tournamentId int64, userID int64) bool
- func MapOfIDTeams(c appengine.Context, tournament *Tournament) map[int64]string
- func MatchKeyByID(c appengine.Context, id int64) *datastore.Key
- func PredictKeyByID(c appengine.Context, id int64) *datastore.Key
- func PredictKeysByIds(c appengine.Context, ids []int64) []*datastore.Key
- func PriceKeyByID(c appengine.Context, id int64) *datastore.Key
- func SaveActivities(c appengine.Context, activities []*Activity) error
- func SaveScores(c appengine.Context, scores []*Score, keys []*datastore.Key) error
- func ScoreKeyByID(c appengine.Context, id int64) *datastore.Key
- func SetResult(c appengine.Context, m *Tmatch, result1 int64, result2 int64, t *Tournament) error
- func SetResults(c appengine.Context, matches []*Tmatch, results1 []int64, results2 []int64, ...) error
- func TeamInvertedIndexGetWordCount(c appengine.Context) (int64, error)
- func TeamInvertedIndexKeyByID(c appengine.Context, id int64) *datastore.Key
- func TeamKeyByID(c appengine.Context, Id int64) *datastore.Key
- func TeamScore(c appengine.Context, query string, ids []int64) []int64
- func TeamsKeysByIDs(c appengine.Context, IDs []int64) []*datastore.Key
- func TournamentInvertedIndexGetWordCount(c appengine.Context) (int64, error)
- func TournamentInvertedIndexKeyByID(c appengine.Context, id int64) *datastore.Key
- func TournamentKeyByID(c appengine.Context, id int64) *datastore.Key
- func TournamentKeysByIds(c appengine.Context, ids []int64) []*datastore.Key
- func TournamentScore(c appengine.Context, query string, ids []int64) []int64
- func UpdateGroup(c appengine.Context, g *Tgroup) error
- func UpdateGroups(c appengine.Context, groups []*Tgroup) error
- func UpdateMatch(c appengine.Context, m *Tmatch) error
- func UpdateMatches(c appengine.Context, matches []*Tmatch) error
- func UpdateNextPhase(c appengine.Context, t *Tournament, currentphase *Tphase, nextphase *Tphase) error
- func UpdatePointsAndGoals(c appengine.Context, g *Tgroup, m *Tmatch, tournament *Tournament) error
- func UpdateScores(c appengine.Context, scores []*Score) error
- func UpdateTeamInvertedIndex(c appengine.Context, oldname string, newname string, id int64) error
- func UpdateTeams(c appengine.Context, teams []*Team) error
- func UpdateTournamentInvertedIndex(c appengine.Context, oldname string, newname string, id int64) error
- func UpdateUserInvertedIndex(c appengine.Context, oldname string, newname string, id int64) error
- func UpdateUsers(c appengine.Context, users []*User) error
- func UserInvertedIndexGetWordCount(c appengine.Context) (int64, error)
- func UserInvertedIndexKeyByID(c appengine.Context, id int64) *datastore.Key
- func UserKeyByID(c appengine.Context, id int64) *datastore.Key
- func UserKeysByIds(c appengine.Context, ids []int64) []*datastore.Key
- func UserScore(c appengine.Context, query string, ids []int64) []int64
- func WasTeamRequestSent(c appengine.Context, teamID int64, userID int64) bool
- type AccOfTournaments
- type Accuracy
- type AccuracyJSON
- type AccuracyOverall
- type Activity
- type ActivityEntity
- type ActivityJSON
- type ByDate
- type ChampionsLeagueTournament
- func (clt ChampionsLeagueTournament) ArrayOfPhases() []string
- func (clt ChampionsLeagueTournament) MapOf2ndRoundMatches() map[string][][]string
- func (clt ChampionsLeagueTournament) MapOfGroupMatches() map[string][][]string
- func (clt ChampionsLeagueTournament) MapOfGroups() map[string][]string
- func (clt ChampionsLeagueTournament) MapOfIDTeams(c appengine.Context, tournament *Tournament) map[int64]string
- func (clt ChampionsLeagueTournament) MapOfPhaseIntervals() map[string][]int64
- func (clt ChampionsLeagueTournament) MapOfTeamCodes() map[string]string
- type ChampionsLeagueTournament20152016
- func (clt ChampionsLeagueTournament20152016) ArrayOfPhases() []string
- func (clt ChampionsLeagueTournament20152016) MapOf2ndRoundMatches() map[string][][]string
- func (clt ChampionsLeagueTournament20152016) MapOfGroupMatches() map[string][][]string
- func (clt ChampionsLeagueTournament20152016) MapOfGroups() map[string][]string
- func (clt ChampionsLeagueTournament20152016) MapOfIDTeams(c appengine.Context, tournament *Tournament) map[int64]string
- func (clt ChampionsLeagueTournament20152016) MapOfPhaseIntervals() map[string][]int64
- func (clt ChampionsLeagueTournament20152016) MapOfTeamCodes() map[string]string
- type CopaAmericaTournament
- func (cat CopaAmericaTournament) ArrayOfPhases() []string
- func (cat CopaAmericaTournament) MapOf2ndRoundMatches() map[string][][]string
- func (cat CopaAmericaTournament) MapOfGroupMatches() map[string][][]string
- func (cat CopaAmericaTournament) MapOfGroups() map[string][]string
- func (cat CopaAmericaTournament) MapOfIDTeams(c appengine.Context, tournament *Tournament) map[int64]string
- func (cat CopaAmericaTournament) MapOfPhaseIntervals() map[string][]int64
- func (cat CopaAmericaTournament) MapOfTeamCodes() map[string]string
- type CopaAmericaTournament2016
- func (cat CopaAmericaTournament2016) ArrayOfPhases() []string
- func (cat CopaAmericaTournament2016) MapOf2ndRoundMatches() map[string][][]string
- func (cat CopaAmericaTournament2016) MapOfGroupMatches() map[string][][]string
- func (cat CopaAmericaTournament2016) MapOfGroups() map[string][]string
- func (cat CopaAmericaTournament2016) MapOfIDTeams(c appengine.Context, tournament *Tournament) map[int64]string
- func (cat CopaAmericaTournament2016) MapOfPhaseIntervals() map[string][]int64
- func (cat CopaAmericaTournament2016) MapOfTeamCodes() map[string]string
- type EuroTournament2016
- func (et EuroTournament2016) ArrayOfPhases() []string
- func (et EuroTournament2016) MapOf2ndRoundMatches() map[string][][]string
- func (et EuroTournament2016) MapOfGroupMatches() map[string][][]string
- func (et EuroTournament2016) MapOfGroups() map[string][]string
- func (et EuroTournament2016) MapOfIDTeams(c appengine.Context, tournament *Tournament) map[int64]string
- func (et EuroTournament2016) MapOfPhaseIntervals() map[string][]int64
- func (et EuroTournament2016) MapOfTeamCodes() map[string]string
- type Predict
- func CreatePredict(c appengine.Context, userID, result1, result2, matchID int64) (*Predict, error)
- func FindAllPredicts(c appengine.Context) []*Predict
- func FindPredictByUserMatch(c appengine.Context, userID, matchID int64) *Predict
- func FindPredicts(c appengine.Context, filter string, value interface{}) []*Predict
- func PredictByID(c appengine.Context, id int64) (*Predict, error)
- func PredictsByIds(c appengine.Context, ids []int64) ([]*Predict, error)
- type Predicts
- type Price
- type Progression
- type Publisher
- type Score
- func CreateScore(c appengine.Context, userID int64, tournamentId int64) (*Score, error)
- func CreateScores(c appengine.Context, userIDs []int64, tournamentId int64) ([]*Score, []*datastore.Key, error)
- func ScoreByID(c appengine.Context, id int64) (*Score, error)
- func ScoreByUserTournament(c appengine.Context, userID interface{}, tournamentId interface{}) []*Score
- type ScoreJSON
- type ScoreOfTournament
- type ScoreOverall
- type Tday
- type Team
- func CreateTeam(c appengine.Context, name string, description string, adminID int64, ...) (*Team, error)
- func FindAllTeams(c appengine.Context) []*Team
- func FindTeams(c appengine.Context, filter string, value interface{}) []*Team
- func GetNotJoinedTeams(c appengine.Context, u *User, count, page int64) []*Team
- func TeamByID(c appengine.Context, Id int64) (*Team, error)
- func TeamsByIDs(c appengine.Context, IDs []int64) ([]*Team, error)
- func (t *Team) Accuracies(c appengine.Context) []*Accuracy
- func (t *Team) AccuraciesGroupByTournament(c appengine.Context, limit int) *[]AccuracyOverall
- func (t *Team) AccuracyByTournament(c appengine.Context, tour *Tournament) *AccuracyOverall
- func (t *Team) AddAdmin(c appengine.Context, id int64) error
- func (t *Team) AddPriceID(c appengine.Context, pID int64) error
- func (t *Team) AddTournamentAccuracy(c appengine.Context, accuracyID int64, tournamentId int64) error
- func (t *Team) AddTournamentID(c appengine.Context, tID int64) error
- func (t *Team) AddUserID(c appengine.Context, uID int64) error
- func (t *Team) AddUserToTournaments(c appengine.Context, uID int64) error
- func (t *Team) ContainsAdminID(id int64) (bool, int)
- func (t *Team) ContainsPriceID(id int64) (bool, int)
- func (t *Team) ContainsTournamentID(id int64) (bool, int)
- func (t *Team) ContainsUserID(id int64) (bool, int)
- func (t *Team) Destroy(c appengine.Context) error
- func (t *Team) Entity() ActivityEntity
- func (t *Team) Join(c appengine.Context, u *User) error
- func (t *Team) Joined(c appengine.Context, u *User) bool
- func (t *Team) Leave(c appengine.Context, u *User) error
- func (t *Team) Players(c appengine.Context) ([]*User, error)
- func (t *Team) PriceByTournament(c appengine.Context, tid int64) *Price
- func (t *Team) Prices(c appengine.Context) []*Price
- func (t *Team) Publish(c appengine.Context, activityType string, verb string, object ActivityEntity, ...) error
- func (t *Team) RankingByUser(c appengine.Context, limit int) []*User
- func (t *Team) RemoveAdmin(c appengine.Context, id int64) error
- func (t *Team) RemovePriceByTournamentID(c appengine.Context, tID int64) error
- func (t *Team) RemoveTournamentID(c appengine.Context, tID int64) error
- func (t *Team) RemoveUserID(c appengine.Context, uID int64) error
- func (t *Team) TournamentAcc(c appengine.Context, tournament *Tournament) (*Accuracy, error)
- func (t *Team) Tournaments(c appengine.Context) []*Tournament
- func (t *Team) Update(c appengine.Context) error
- func (t *Team) UpdateAccuracy(c appengine.Context, tID int64, newAccuracy float64) error
- type TeamByAccuracy
- type TeamInvertedIndex
- type TeamInvertedIndexJSON
- type TeamJSON
- type TeamRequest
- func CreateTeamRequest(c appengine.Context, teamID int64, teamName string, userID int64, ...) (*TeamRequest, error)
- func FindTeamRequest(c appengine.Context, filter string, value interface{}) []*TeamRequest
- func TeamRequestByID(c appengine.Context, id int64) (*TeamRequest, error)
- func TeamsRequests(c appengine.Context, teams []*Team) []*TeamRequest
- type TeamRequestJSON
- type Tgroup
- type Tmatch
- func GetAllMatchesFromTournament(c appengine.Context, tournament *Tournament) []*Tmatch
- func GetMatchByIDNumber(c appengine.Context, tournament Tournament, matchInternalID int64) *Tmatch
- func GetMatchesByPhase(c appengine.Context, t *Tournament, phaseName string) []*Tmatch
- func MatchByID(c appengine.Context, matchID int64) (*Tmatch, error)
- func Matches(c appengine.Context, matchIds []int64) []*Tmatch
- type Tournament
- func CreateChampionsLeague(c appengine.Context, adminID int64) (*Tournament, error)
- func CreateChampionsLeague20152016(c appengine.Context, adminId int64) (*Tournament, error)
- func CreateCopaAmerica(c appengine.Context, adminID int64) (*Tournament, error)
- func CreateCopaAmerica2016(c appengine.Context, adminID int64) (*Tournament, error)
- func CreateEuro2016(c appengine.Context, adminID int64) (*Tournament, error)
- func CreateTournament(c appengine.Context, name string, description string, start time.Time, ...) (*Tournament, error)
- func CreateWorldCup(c appengine.Context, adminID int64) (*Tournament, error)
- func CreateWorldCup2018(c appengine.Context, adminID int64) (*Tournament, error)
- func FindAllTournaments(c appengine.Context, count, page int64) []*Tournament
- func FindTournaments(c appengine.Context, filter string, value interface{}) []*Tournament
- func TournamentByID(c appengine.Context, id int64) (*Tournament, error)
- func TournamentsByIds(c appengine.Context, ids []int64) ([]*Tournament, error)
- func (t *Tournament) AddAdmin(c appengine.Context, id int64) error
- func (t *Tournament) AddTeamID(c appengine.Context, tID int64) error
- func (t *Tournament) AddUserID(c appengine.Context, uID int64) error
- func (t *Tournament) AddUserIDs(c appengine.Context, uIds []int64) error
- func (t *Tournament) ContainsAdminID(id int64) (bool, int)
- func (t *Tournament) ContainsTeamID(id int64) (bool, int)
- func (t *Tournament) ContainsUserID(id int64) (bool, int)
- func (t *Tournament) Destroy(c appengine.Context) error
- func (t *Tournament) Entity() ActivityEntity
- func (t *Tournament) IsMatchInGroup(c appengine.Context, m *Tmatch) (bool, *Tgroup)
- func (t *Tournament) Join(c appengine.Context, u *User) error
- func (t *Tournament) Joined(c appengine.Context, u *User) bool
- func (t *Tournament) OldMatches(c appengine.Context) int
- func (t *Tournament) Participants(c appengine.Context) []*User
- func (t *Tournament) Progress(c appengine.Context) float64
- func (t *Tournament) Publish(c appengine.Context, activityType string, verb string, object ActivityEntity, ...) error
- func (t *Tournament) RankingByTeam(c appengine.Context, limit int) []*Team
- func (t *Tournament) RankingByUser(c appengine.Context, limit int) []*User
- func (t *Tournament) RemoveAdmin(c appengine.Context, id int64) error
- func (t *Tournament) RemoveTeamID(c appengine.Context, tID int64) error
- func (t *Tournament) RemoveUserID(c appengine.Context, uID int64) error
- func (t *Tournament) Reset(c appengine.Context) error
- func (t *Tournament) TeamJoin(c appengine.Context, team *Team) error
- func (t *Tournament) TeamJoined(c appengine.Context, team *Team) bool
- func (t *Tournament) TeamLeave(c appengine.Context, team *Team) error
- func (t *Tournament) Teams(c appengine.Context) []*Team
- func (t *Tournament) Update(c appengine.Context) error
- func (t *Tournament) UpdateTeamsAccuracy(c appengine.Context, m *Tmatch) error
- func (t *Tournament) UpdateTournamentTeam(c appengine.Context, phaseName, oldName, newName string) error
- func (t *Tournament) UpdateUsersScore(c appengine.Context, m *Tmatch) error
- type TournamentBuilder
- type TournamentInvertedIndex
- type TournamentInvertedIndexJSON
- type TournamentJSON
- type Tphase
- type Tteam
- type User
- func CreateUser(c appengine.Context, email, username, name, alias string, isAdmin bool, ...) (*User, error)
- func FindAllUsers(c appengine.Context) []*User
- func FindUser(c appengine.Context, filter string, value interface{}) *User
- func FindUsers(c appengine.Context, filter string, value interface{}) []*User
- func SigninUser(c appengine.Context, queryName string, email string, username string, ...) (*User, error)
- func UserByID(c appengine.Context, id int64) (*User, error)
- func UsersByIds(c appengine.Context, ids []int64) ([]*User, error)
- func (u *User) AddPredictID(c appengine.Context, pID int64) error
- func (u *User) AddTeamID(c appengine.Context, tID int64) error
- func (u *User) AddTournamentID(c appengine.Context, tID int64) error
- func (u *User) AddTournamentScore(c appengine.Context, scoreID int64, tourID int64) error
- func (u *User) BuildActivity(c appengine.Context, activityType string, verb string, object ActivityEntity, ...) *Activity
- func (u *User) ContainsTeamID(id int64) (bool, int)
- func (u *User) ContainsTournamentID(id int64) (bool, int)
- func (u *User) Destroy(c appengine.Context) error
- func (u *User) Entity() ActivityEntity
- func (u *User) Invitations(c appengine.Context) []*Team
- func (u *User) PredictFromMatchID(c appengine.Context, mID int64) (*Predict, error)
- func (u *User) Publish(c appengine.Context, activityType string, verb string, object ActivityEntity, ...) error
- func (u *User) RemoveTeamID(c appengine.Context, tID int64) error
- func (u *User) RemoveTournamentID(c appengine.Context, tID int64) error
- func (u *User) ScoreByTournament(c appengine.Context, tID int64) int64
- func (u *User) ScoreForMatch(c appengine.Context, m *Tmatch) (int64, error)
- func (u *User) Scores(c appengine.Context) []*Score
- func (u *User) Teams(c appengine.Context) []*Team
- func (u *User) TeamsByPage(c appengine.Context, count, page int64) []*Team
- func (u *User) TournamentScore(c appengine.Context, tournament *Tournament) (*Score, error)
- func (u *User) Tournaments(c appengine.Context) []*Tournament
- func (u *User) TournamentsByPage(c appengine.Context, count, page int64) []*Tournament
- func (u *User) TournamentsScores(c appengine.Context) []*ScoreOverall
- func (u *User) Update(c appengine.Context) error
- type UserByScore
- type UserInvertedIndex
- type UserInvertedIndexJSON
- type UserJSON
- type UserRequest
- func CreateUserRequest(c appengine.Context, teamID int64, userID int64) (*UserRequest, error)
- func FindUserRequestByTeamAndUser(c appengine.Context, teamID int64, userID int64) *UserRequest
- func FindUserRequests(c appengine.Context, filter string, value interface{}) []*UserRequest
- func UserRequestByID(c appengine.Context, id int64) (*UserRequest, error)
- type UserRequestJSON
- type WordCountTeam
- type WordCountTournament
- type WordCountUser
- type WorldCupTournament
- func (wct WorldCupTournament) ArrayOfPhases() []string
- func (wct WorldCupTournament) MapOf2ndRoundMatches() map[string][][]string
- func (wct WorldCupTournament) MapOfGroupMatches() map[string][][]string
- func (wct WorldCupTournament) MapOfGroups() map[string][]string
- func (wct WorldCupTournament) MapOfIDTeams(c appengine.Context, tournament *Tournament) map[int64]string
- func (wct WorldCupTournament) MapOfPhaseIntervals() map[string][]int64
- func (wct WorldCupTournament) MapOfTeamCodes() map[string]string
- type WorldCupTournament2018
- func (wct WorldCupTournament2018) ArrayOfPhases() []string
- func (wct WorldCupTournament2018) MapOf2ndRoundMatches() map[string][][]string
- func (wct WorldCupTournament2018) MapOfGroupMatches() map[string][][]string
- func (wct WorldCupTournament2018) MapOfGroups() map[string][]string
- func (wct WorldCupTournament2018) MapOfIDTeams(c appengine.Context, tournament *Tournament) map[int64]string
- func (wct WorldCupTournament2018) MapOfPhaseIntervals() map[string][]int64
- func (wct WorldCupTournament2018) MapOfTeamCodes() map[string]string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccuracyKeyByID ¶
AccuracyKeyByID gets an accuracy key given an id.
func AddToTeamInvertedIndex ¶
AddToTeamInvertedIndex adds name to team inverted index entity.
We do this by spliting the name in words (split by spaces), for each word we check if it already exists a team inverted index entity. If it does not yet exist, we create an entity with the word as key and team id as value.
func AddToTournamentInvertedIndex ¶
AddToTournamentInvertedIndex adds name to tournament inverted index entity.
We do this by spliting the name in words (split by spaces), for each word we check if it already exists a team inverted index entity. If it does not yet exist, we create an entity with the word as key and tournament id as value.
func AddToUserInvertedIndex ¶
AddToUserInvertedIndex add a name the user inverted index entity.
We do this by spliting the name in words (split by spaces), for each word we check if it already exists a user inverted index entity. If it does not yet exist, we create an entity with the word as key and user id as value.
func DestroyActivities ¶
DestroyActivities deletes activities in array.
func DestroyGroups ¶
DestroyGroups destroys an array of groups.
func DestroyMatches ¶
DestroyMatches destroys an array of matches.
func DestroyPredicts ¶
DestroyPredicts destroys a list of predicts.
func GenerateAuthKey ¶
func GenerateAuthKey() string
GenerateAuthKey generates authentication string key. We use this function to create an authentication token for a user entity.
func GetTeamFrequencyForWord ¶
GetTeamFrequencyForWord gets the number of teams that have 'word' in their name.
func GetTeamInvertedIndexes ¶
GetTeamInvertedIndexes returns, Given an array of words, an array of indexes that correspond to the team ids of the teams that use these words.
func GetTournamentFrequencyForWord ¶
GetTournamentFrequencyForWord gets the number of tournaments that have 'word' in their name.
func GetTournamentInvertedIndexes ¶
GetTournamentInvertedIndexes returns an array of indexes that correspond to the tournament ids of the tournaments that use these words.
func GetUserFrequencyForWord ¶
GetUserFrequencyForWord gets the number of users that have 'word' in their name.
func GetUserInvertedIndexes ¶
GetUserInvertedIndexes returns, Given an array of words, an array of indexes that correspond to the user ids of the users that use these words.
func GetWordFrequencyForTeam ¶
GetWordFrequencyForTeam will get the frequency of that word in the team terms given a id, and a word.
func GetWordFrequencyForTournament ¶
GetWordFrequencyForTournament gets the frequency of given word with respect to tournament id.
func GetWordFrequencyForUser ¶
GetWordFrequencyForUser gets the frequency of given word with respect to user id.
func GroupKeyByID ¶
GroupKeyByID gets pointer to a group key given a group id.
func IsTeamAdmin ¶
IsTeamAdmin checks if user is admin of the team with id 'teamId'.
func IsTournamentAdmin ¶
IsTournamentAdmin checks if user is admin of tournament with id 'tournamentId'.
func MapOfIDTeams ¶
func MapOfIDTeams(c appengine.Context, tournament *Tournament) map[int64]string
MapOfIDTeams is the map of team IDs of a given tournament.
func MatchKeyByID ¶
MatchKeyByID returns a pointer to a match key given a match id.
func PredictKeyByID ¶
PredictKeyByID gets a Predict key given an id.
func PredictKeysByIds ¶
PredictKeysByIds returns an array of keys with respect to a given array of ids.
func PriceKeyByID ¶
PriceKeyByID gets a Price key given an id.
func SaveActivities ¶
SaveActivities updates an array of users.
func SaveScores ¶
SaveScores saves an array of scores to the datastore.
func ScoreKeyByID ¶
ScoreKeyByID gets a score key given an id.
func SetResult ¶
SetResult sets the result of a match entity and triggers a match update in datastore and score updates.
func SetResults ¶
func SetResults(c appengine.Context, matches []*Tmatch, results1 []int64, results2 []int64, t *Tournament) error
SetResults sets results on an array of matches and triggers a match update and group update.
func TeamInvertedIndexGetWordCount ¶
TeamInvertedIndexGetWordCount returns the current number of words on team names.
func TeamInvertedIndexKeyByID ¶
TeamInvertedIndexKeyByID returns, given an id, a pointer to the corresponding key of a team inverted index entity if found.
func TeamKeyByID ¶
TeamKeyByID gets a team key given a team id.
func TeamScore ¶
TeamScore computes a score vector, given a query string and an array of ids,
that has the doc ids and the score of each id with respect to the query.
func TeamsKeysByIDs ¶
TeamsKeysByIDs returns an array of datastore keys from a given team IDs array.
func TournamentInvertedIndexGetWordCount ¶
TournamentInvertedIndexGetWordCount gets the number of words used in tournament names.
func TournamentInvertedIndexKeyByID ¶
TournamentInvertedIndexKeyByID gets a key pointer to a tournament inverted index entity given an id.
func TournamentKeyByID ¶
TournamentKeyByID gets a pointer to a tournament key given a tournament id.
func TournamentKeysByIds ¶
TournamentKeysByIds finds tournaments keys from an array of ids.
func TournamentScore ¶
TournamentScore computes a score vector, given a query string and an array of ids, that has the doc ids and the score of each id with respect to the query.
func UpdateGroup ¶
UpdateGroup updates a group.
func UpdateGroups ¶
UpdateGroups updates an array of groups.
func UpdateMatch ¶
UpdateMatch updates a match.
func UpdateMatches ¶
UpdateMatches updates an array of matches.
func UpdateNextPhase ¶
func UpdateNextPhase(c appengine.Context, t *Tournament, currentphase *Tphase, nextphase *Tphase) error
UpdateNextPhase updates next phase in tournament.
func UpdatePointsAndGoals ¶
UpdatePointsAndGoals update points in group with result of match.
func UpdateScores ¶
UpdateScores updates an array of scores.
func UpdateTeamInvertedIndex ¶
UpdateTeamInvertedIndex updates the Team inverted index. From the old team name and the new team name we handle the removal of the words that are no longer present and the addition of new words.
func UpdateTeams ¶
UpdateTeams updates an array of teams.
func UpdateTournamentInvertedIndex ¶
func UpdateTournamentInvertedIndex(c appengine.Context, oldname string, newname string, id int64) error
UpdateTournamentInvertedIndex updates a team inverted index given an oldname, a new name and an id.
func UpdateUserInvertedIndex ¶
UpdateUserInvertedIndex updates the User inverted index. From the old user name and the new user name we handle the removal of the words that are no longer present and the addition of new words.
func UpdateUsers ¶
UpdateUsers updates an array of users.
func UserInvertedIndexGetWordCount ¶
UserInvertedIndexGetWordCount returns the current number of words on user names.
func UserInvertedIndexKeyByID ¶
UserInvertedIndexKeyByID returns, given an id, a pointer to the corresponding key of a user inverted index entity if found.
func UserKeyByID ¶
UserKeyByID gets key pointer given a user id.
func UserKeysByIds ¶
UserKeysByIds gets user keys given a list of user ids.
Types ¶
type AccOfTournaments ¶
type AccOfTournaments struct { AccuracyId int64 // id of accuracy entity TournamentId int64 // id of tournament }
AccOfTournaments holds a tournament id and an accuracy id.
type Accuracy ¶
Accuracy is a placeholder for progression of the accuracy of a team in a tournament. Teams should have a global accuracy as well as an accuracy for each tournament they participate in. Teams should be able to see the evolution of their accuracy for each tournament.
The Team accuracy of a specific tournament is computed as follows:
(sum(scores of match for each team member) + previous accuracy) / (number of matches played by the team)
If some participants arrive later to the tournament, previous accuracies count as 0, and this does not impact previous teams accuracy.
func AccuracyByID ¶
AccuracyByID gets a team given an id.
func CreateAccuracy ¶
func CreateAccuracy(c appengine.Context, teamID int64, tournamentId int64, oldmatches int) (*Accuracy, error)
CreateAccuracy creates an Accuracy entity.
type AccuracyJSON ¶
type AccuracyJSON struct { Id *int64 `json:"Id,omitempty"` TeamId *int64 `json:"TeamId,omitempty"` TournamentId *int64 `json:"TournamentId,omitempty"` Accuracies *[]float64 `json:",omitempty"` }
AccuracyJSON is the JSON representation of the Accuracy entity.
type AccuracyOverall ¶
type AccuracyOverall struct { Id int64 TournamentId int64 Accuracy float64 // overall accuracy Progression []Progression // progression of accuracies of team in tournament. (right now the last 5 accuracy logs) }
AccuracyOverall represents the accuracy for a tournament and its progression.
type Activity ¶
type Activity struct { Id int64 Type string // Type of the activity (welcome, team, tournament, match, accuracy, predict, score) Verb string // Describes the action Actor ActivityEntity // The one who/which performs the action Object ActivityEntity // The one who/which is used to performs the action (can be empty) Target ActivityEntity // The one who/which is affected by the action (can be empty) Published time.Time CreatorID int64 }
Activity is an update that shows the activity of the user on gonawin.
An activity can be published as long as a type, a verb and an actor has been specified.
func FindActivities ¶
FindActivities return activities for a specific user.
type ActivityEntity ¶
type ActivityEntity struct { Id int64 `json:"Id,omitempty"` Type string DisplayName string // Name which will be displayed in the view }
ActivityEntity represents the entity of an activity.
type ActivityJSON ¶
type ActivityJSON struct { Id *int64 `json:",omitempty"` Type *string `json:",omitempty"` Verb *string `json:",omitempty"` Actor *ActivityEntity `json:",omitempty"` Object *ActivityEntity `json:",omitempty"` Target *ActivityEntity `json:",omitempty"` Published *time.Time `json:",omitempty"` CreatorID *int64 `json:",omitempty"` }
ActivityJSON is the JSON representation of an activity.
type ByDate ¶
type ByDate []Tday
ByDate implements sort.Interface for []Tday based on the date field.
type ChampionsLeagueTournament ¶
type ChampionsLeagueTournament struct{}
ChampionsLeagueTournament represents the Champions League tournament.
func (ChampionsLeagueTournament) ArrayOfPhases ¶
func (clt ChampionsLeagueTournament) ArrayOfPhases() []string
ArrayOfPhases returns an array of the phases names of champions league tournament: (QuarterFinals, SemiFinals, Finals).
func (ChampionsLeagueTournament) MapOf2ndRoundMatches ¶
func (clt ChampionsLeagueTournament) MapOf2ndRoundMatches() map[string][][]string
MapOf2ndRoundMatches returns the Map of 2nd round matches, of the Champions League tournament. key: round number, value: array of array of strings with match information ( MatchId, MatchDate, MatchTeam1, MatchTeam2, MatchLocation)
Example:
round 4:[{"1", "Apr/14/2014", "Paris Saint-Germain", "AS Monaco FC", "Parc des Princes, Paris"}, ...]
func (ChampionsLeagueTournament) MapOfGroupMatches ¶
func (clt ChampionsLeagueTournament) MapOfGroupMatches() map[string][][]string
MapOfGroupMatches is a map containing the matches accessible by group.
func (ChampionsLeagueTournament) MapOfGroups ¶
func (clt ChampionsLeagueTournament) MapOfGroups() map[string][]string
MapOfGroups is a map containing the groups of a tournament. key: group name, value: string array of teams.
func (ChampionsLeagueTournament) MapOfIDTeams ¶
func (clt ChampionsLeagueTournament) MapOfIDTeams(c appengine.Context, tournament *Tournament) map[int64]string
MapOfIDTeams builds a map of teams from tournament entity.
func (ChampionsLeagueTournament) MapOfPhaseIntervals ¶
func (clt ChampionsLeagueTournament) MapOfPhaseIntervals() map[string][]int64
MapOfPhaseIntervals builds a map with key the corresponding phase in the champions league tournament at value a tuple that represent the match number interval in which the phase take place: Quarter-finals: matches 1 to 8 Semi-finals: matches 9 to 12 Finals: match 13
func (ChampionsLeagueTournament) MapOfTeamCodes ¶
func (clt ChampionsLeagueTournament) MapOfTeamCodes() map[string]string
MapOfTeamCodes is map containing the team codes. key: team name, value: code example: Paris Saint-Germain: PSG
type ChampionsLeagueTournament20152016 ¶
type ChampionsLeagueTournament20152016 struct{}
func (ChampionsLeagueTournament20152016) ArrayOfPhases ¶
func (clt ChampionsLeagueTournament20152016) ArrayOfPhases() []string
Return an array of the phases names of champions league tournament: (QuarterFinals, SemiFinals, Finals)
func (ChampionsLeagueTournament20152016) MapOf2ndRoundMatches ¶
func (clt ChampionsLeagueTournament20152016) MapOf2ndRoundMatches() map[string][][]string
Returns the Map of 2nd round matches, of the world cup tournament. key: round number, value: array of array of strings with match information ( MatchId, MatchDate, MatchTeam1, MatchTeam2, MatchLocation)
Example:
round 4:[{"1", "Apr/14/2014", "Paris Saint-Germain", "AS Monaco FC", "Parc des Princes, Paris"}, ...]
func (ChampionsLeagueTournament20152016) MapOfGroupMatches ¶
func (clt ChampionsLeagueTournament20152016) MapOfGroupMatches() map[string][][]string
func (ChampionsLeagueTournament20152016) MapOfGroups ¶
func (clt ChampionsLeagueTournament20152016) MapOfGroups() map[string][]string
Map of groups, key: group name, value: string array of teams.
func (ChampionsLeagueTournament20152016) MapOfIDTeams ¶
func (clt ChampionsLeagueTournament20152016) MapOfIDTeams(c appengine.Context, tournament *Tournament) map[int64]string
From tournament entity build map of teams.
func (ChampionsLeagueTournament20152016) MapOfPhaseIntervals ¶
func (clt ChampionsLeagueTournament20152016) MapOfPhaseIntervals() map[string][]int64
Build a map with key the corresponding phase in the champions league tournament at value a tuple that represent the match number interval in which the phase take place: Quarter-finals: matches 1 to 8 Semi-finals: matches 9 to 12 Finals: match 13
func (ChampionsLeagueTournament20152016) MapOfTeamCodes ¶
func (clt ChampionsLeagueTournament20152016) MapOfTeamCodes() map[string]string
Map of team codes, key: team name, value: code example: Paris Saint-Germain: PSG
type CopaAmericaTournament ¶
type CopaAmericaTournament struct { }
CopaAmericaTournament is a placeholder for the Copa America Tournament.
func (CopaAmericaTournament) ArrayOfPhases ¶
func (cat CopaAmericaTournament) ArrayOfPhases() []string
ArrayOfPhases returns an array of the phases names of world cup tournament: FirstStage, RoundOf16, QuarterFinals, SemiFinals, ThirdPlace, Finals
func (CopaAmericaTournament) MapOf2ndRoundMatches ¶
func (cat CopaAmericaTournament) MapOf2ndRoundMatches() map[string][][]string
MapOf2ndRoundMatches returns the map of 2nd round matches, of the tournament. key: round number, value: array of array of strings with match information: MatchId, MatchDate, MatchTeam1, MatchTeam2, MatchLocation
Example:
round 16:[{"1", "Jun/12/2014", "Brazil", "Croatia", "Arena de São Paulo, São Paulo"}, ...]
func (CopaAmericaTournament) MapOfGroupMatches ¶
func (cat CopaAmericaTournament) MapOfGroupMatches() map[string][][]string
MapOfGroupMatches return a map with the maches of all the groups key: group name, value: array of array of strings with match information: MatchId, MatchDate, MatchTeam1, MatchTeam2, MatchLocation
Example:
Group A:[{"1", "Jun/12/2014", "Brazil", "Croatia", "Arena de São Paulo, São Paulo"}, ...]
func (CopaAmericaTournament) MapOfGroups ¶
func (cat CopaAmericaTournament) MapOfGroups() map[string][]string
MapOfGroups represents the groupsof a tournament, key: group name, value: string array of teams.
func (CopaAmericaTournament) MapOfIDTeams ¶
func (cat CopaAmericaTournament) MapOfIDTeams(c appengine.Context, tournament *Tournament) map[int64]string
MapOfIDTeams returns a map of team IDs as keys and team names as values.
func (CopaAmericaTournament) MapOfPhaseIntervals ¶
func (cat CopaAmericaTournament) MapOfPhaseIntervals() map[string][]int64
MapOfPhaseIntervals returns a map with key the corresponding phase in the copa america tournament at value a tuple that represent the match number interval in which the phase take place: first stage: matches 1 to 48 Round of 16: matches 49 to 56 Quarte-finals: matches 57 to 60 Semi-finals: matches 61 to 62 Third Place: match 63 Finals: match 64
func (CopaAmericaTournament) MapOfTeamCodes ¶
func (cat CopaAmericaTournament) MapOfTeamCodes() map[string]string
MapOfTeamCodes is the map of country codes, key: team name, value: ISO code example: Brazil: BR
type CopaAmericaTournament2016 ¶
type CopaAmericaTournament2016 struct { }
CopaAmericaTournament2016 is a placeholder for the Copa America Tournament.
func (CopaAmericaTournament2016) ArrayOfPhases ¶
func (cat CopaAmericaTournament2016) ArrayOfPhases() []string
ArrayOfPhases returns an array of the phases names of world cup tournament: FirstStage, RoundOf16, QuarterFinals, SemiFinals, ThirdPlace, Finals
func (CopaAmericaTournament2016) MapOf2ndRoundMatches ¶
func (cat CopaAmericaTournament2016) MapOf2ndRoundMatches() map[string][][]string
MapOf2ndRoundMatches returns the map of 2nd round matches, of the tournament. key: round number, value: array of array of strings with match information: MatchId, MatchDate, MatchTeam1, MatchTeam2, MatchLocation
Example:
round 16:[{"1", "Jun/12/2014", "Brazil", "Croatia", "Arena de São Paulo, São Paulo"}, ...]
func (CopaAmericaTournament2016) MapOfGroupMatches ¶
func (cat CopaAmericaTournament2016) MapOfGroupMatches() map[string][][]string
MapOfGroupMatches return a map with the maches of all the groups key: group name, value: array of array of strings with match information: MatchId, MatchDate, MatchTeam1, MatchTeam2, MatchLocation
Example:
Group A:[{"1", "Jun/12/2014", "Brazil", "Croatia", "Arena de São Paulo, São Paulo"}, ...]
func (CopaAmericaTournament2016) MapOfGroups ¶
func (cat CopaAmericaTournament2016) MapOfGroups() map[string][]string
MapOfGroups represents the groupsof a tournament, key: group name, value: string array of teams.
func (CopaAmericaTournament2016) MapOfIDTeams ¶
func (cat CopaAmericaTournament2016) MapOfIDTeams(c appengine.Context, tournament *Tournament) map[int64]string
MapOfIDTeams returns a map of team IDs as keys and team names as values.
func (CopaAmericaTournament2016) MapOfPhaseIntervals ¶
func (cat CopaAmericaTournament2016) MapOfPhaseIntervals() map[string][]int64
MapOfPhaseIntervals returns a map with key the corresponding phase in the copa america tournament at value a tuple that represent the match number interval in which the phase take place: first stage: matches 1 to 48 Round of 16: matches 49 to 56 Quarte-finals: matches 57 to 60 Semi-finals: matches 61 to 62 Third Place: match 63 Finals: match 64
func (CopaAmericaTournament2016) MapOfTeamCodes ¶
func (cat CopaAmericaTournament2016) MapOfTeamCodes() map[string]string
MapOfTeamCodes is the map of country codes, key: team name, value: ISO code example: Brazil: BR
type EuroTournament2016 ¶
type EuroTournament2016 struct { }
EuroTournament2016 represents a Euro tournament.
func (EuroTournament2016) ArrayOfPhases ¶
func (et EuroTournament2016) ArrayOfPhases() []string
ArrayOfPhases returns an array of the phases names of champions league tournament: (QuarterFinals, SemiFinals, Finals).
func (EuroTournament2016) MapOf2ndRoundMatches ¶
func (et EuroTournament2016) MapOf2ndRoundMatches() map[string][][]string
MapOf2ndRoundMatches returns the Map of 2nd round matches, of the euro tournament. key: round number, value: array of array of strings with match information ( MatchId, MatchDate, MatchTeam1, MatchTeam2, MatchLocation)
Example:
round 16:[{"1", "Jun/12/2014", "Brazil", "Croatia", "Arena de São Paulo, São Paulo"}, ...]
func (EuroTournament2016) MapOfGroupMatches ¶
func (et EuroTournament2016) MapOfGroupMatches() map[string][][]string
MapOfGroupMatches is a map containing the matches accessible by group.
Example:
Group A:[{"1", "Jun/12/2014", "Brazil", "Croatia", "Arena de São Paulo, São Paulo"}, ...]
func (EuroTournament2016) MapOfGroups ¶
func (et EuroTournament2016) MapOfGroups() map[string][]string
MapOfGroups is a map containing the groups of a tournament. key: group name, value: string array of teams.
func (EuroTournament2016) MapOfIDTeams ¶
func (et EuroTournament2016) MapOfIDTeams(c appengine.Context, tournament *Tournament) map[int64]string
MapOfIDTeams builds a map of teams from tournament entity.
func (EuroTournament2016) MapOfPhaseIntervals ¶
func (et EuroTournament2016) MapOfPhaseIntervals() map[string][]int64
MapOfPhaseIntervals builds a map with key the corresponding phase in the world cup tournament at value a tuple that represent the match number interval in which the phase take place: first stage: matches 1 to 48 Round of 16: matches 49 to 56 Quarte-finals: matches 57 to 60 Semi-finals: matches 61 to 62 Third Place: match 63 Finals: match 64
func (EuroTournament2016) MapOfTeamCodes ¶
func (et EuroTournament2016) MapOfTeamCodes() map[string]string
MapOfTeamCodes is map containing the team codes. key: team name, value: code example: Brazil: BR
type Predict ¶
type Predict struct { Id int64 // predict id UserId int64 // user id, a prediction is binded to a single user. Result1 int64 // result of first team Result2 int64 // result of second team MatchId int64 // match id in tournament Created time.Time // date of creation }
Predict is an entity defined by the result of a Match: Result1 and Result2 a match id and a user id.
func CreatePredict ¶
CreatePredict creates a Predict entity given a name, a user id, a result and a match id admin id and a private mode.
func FindAllPredicts ¶
FindAllPredicts gets all Predicts in datastore.
func FindPredictByUserMatch ¶
FindPredictByUserMatch searches for a Predict entity given a userId and a matchId. The pair (user id , match id) should be unique. So if the query returns more than one entity we return 'nil' and write in the error log.
func FindPredicts ¶
FindPredicts searches for all Predict entities with respect to a filter and a value.
func PredictByID ¶
PredictByID gets a Predict given an id.
func PredictsByIds ¶
PredictsByIds returns an array of pointers to Predict entities with respect to an array of ids.
type Price ¶
type Price struct { Id int64 // price id TeamId int64 // team id, a price is binded to a single team. TournamentId int64 // tournament id, a price is binded to a single team. TournamentName string // tournament name. Description string // the description of the price Created time.Time // date of creation }
A Price entity is defined by a description of the price that the winner gets for a specific tournament.
func CreatePrice ¶
func CreatePrice(c appengine.Context, teamID, tournamentId int64, tournamentName string, description string) (*Price, error)
CreatePrice creates a Price entity given a description, a team id and a tournament id.
func FindPricesByTeam ¶
FindPricesByTeam searches for a Predict entity given a userId and a matchId. The pair (user id , match id) should be unique. So if the query returns more than one entity we return 'nil' and write in the error log.
func PricesByIds ¶
PricesByIds gets an array of pointers to Price entities with respect to an array of ids.
type Progression ¶
type Progression struct {
Value float64
}
Progression holds the progression of an accuracy
type Publisher ¶
type Publisher interface { Publish(c appengine.Context, activityType string, verb string, object ActivityEntity, target ActivityEntity) error Entity() ActivityEntity }
Publisher interface
type Score ¶
Score entity is a placeholder for progression of the score of a user in a tournament.
A User should have a score as well as a score for each tournament it participates in. It should be able to access the history of his score in a specific tournament.
The score of a user evolves following the same rules.
If the prediction matches perfectly you get a +3 If prediction matches the trend you get a +1 If the prediction does not match the match result you get +0.
func CreateScore ¶
CreateScore creates a Score entity.
func CreateScores ¶
func CreateScores(c appengine.Context, userIDs []int64, tournamentId int64) ([]*Score, []*datastore.Key, error)
CreateScores creates a Score entity.
func ScoreByUserTournament ¶
func ScoreByUserTournament(c appengine.Context, userID interface{}, tournamentId interface{}) []*Score
ScoreByUserTournament gets an array of scores for a user, tournament pair.
type ScoreJSON ¶
type ScoreJSON struct { Id *int64 `json:",omitempty"` UserId *int64 `json:",omitempty"` TournamentId *int64 `json:",omitempty"` Scores *[]int64 `json:",omitempty"` }
ScoreJSON is the Json version of the Score struct
type ScoreOfTournament ¶
type ScoreOfTournament struct { ScoreId int64 // id of score entity TournamentId int64 // id of tournament }
ScoreOfTournament holds the user's score for a tournament.
type ScoreOverall ¶
type ScoreOverall struct { Id int64 UserId int64 TournamentId int64 Score int64 LastProgression int64 }
ScoreOverall is a placeholder for the overall score of a user in different tournaments.
type Tday ¶
Tday represents a tournament day. It holds the date of the day and the array of matches.
func MatchesGroupByDay ¶
MatchesGroupByDay gets all matches grouped by days. Returns an array of days.
type Team ¶
type Team struct { Id int64 KeyName string Name string Description string AdminIds []int64 // ids of User that are admins of the team Private bool Created time.Time UserIds []int64 // ids of Users <=> members of the team. TournamentIds []int64 // ids of Tournaments <=> Tournaments the team subscribed. Accuracy float64 // Overall Team accuracy. AccOfTournaments []AccOfTournaments // ids of Accuracies for each tournament the team is participating on . PriceIds []int64 // ids of Prices <=> prices defined for each tournament the team participates. MembersCount int64 // number of members in team }
Team holds tournament entity data.
func CreateTeam ¶
func CreateTeam(c appengine.Context, name string, description string, adminID int64, private bool) (*Team, error)
CreateTeam creates a team given a name, description, an admin id and a private mode.
func FindAllTeams ¶
FindAllTeams gets all teams in datastore.
func GetNotJoinedTeams ¶
GetNotJoinedTeams gets all teams that a user has not joined with respect to the count and page.
func TeamsByIDs ¶
TeamsByIDs returns an array of teams from a given team IDs array. An error could be returned.
func (*Team) Accuracies ¶
Accuracies returns an array of accuracy the user is involved in.
func (*Team) AccuraciesGroupByTournament ¶
func (t *Team) AccuraciesGroupByTournament(c appengine.Context, limit int) *[]AccuracyOverall
AccuraciesGroupByTournament gets an array of type accuracyOverall which holds the accuracy information and the last 5 progression of each tournament.
func (*Team) AccuracyByTournament ¶
func (t *Team) AccuracyByTournament(c appengine.Context, tour *Tournament) *AccuracyOverall
AccuracyByTournament gets the overall accuracy of a team in the specified tournament. the progression of accuracies is in reverse order to have the most reset accuracy as first element.
func (*Team) AddAdmin ¶
AddAdmin adds user to admins of current team. In order to be an admin of a team you should first be a member of the team.
func (*Team) AddPriceID ¶
AddPriceID adds a tournament Id in the TournamentId array.
func (*Team) AddTournamentAccuracy ¶
func (t *Team) AddTournamentAccuracy(c appengine.Context, accuracyID int64, tournamentId int64) error
AddTournamentAccuracy adds accuracy to team entity and run update.
func (*Team) AddTournamentID ¶
AddTournamentID adds a tournament Id in the TournamentId array.
func (*Team) AddUserToTournaments ¶
AddUserToTournaments add user to teams current tournaments.
func (*Team) ContainsAdminID ¶
ContainsAdminID checks if user is admin of team.
func (*Team) ContainsPriceID ¶
ContainsPriceID checks if a given price id exists in a team entity.
func (*Team) ContainsTournamentID ¶
ContainsTournamentID checks if a given tournament id exists in a team entity.
func (*Team) ContainsUserID ¶
ContainsUserID checks if user is part of team.
func (*Team) Entity ¶
func (t *Team) Entity() ActivityEntity
Entity is the Activity entity representation of a team
func (*Team) Join ¶
Join let a user join a team. TeamId is added to user entity. UserId is added to team entity. UserId is added to all current tournaments joined by the team entity.
func (*Team) Leave ¶
Leave makes a user leave a team. Todo: Should we check that the user is indeed a member of the team?
func (*Team) PriceByTournament ¶
PriceByTournament get the price of a tournament
func (*Team) Publish ¶
func (t *Team) Publish(c appengine.Context, activityType string, verb string, object ActivityEntity, target ActivityEntity) error
Publish publishes new team activity.
func (*Team) RankingByUser ¶
RankingByUser returns an array of user sorted by their score.
func (*Team) RemoveAdmin ¶
RemoveAdmin remove user of admins array in current team. In order to remove an admin from a team, there should be at least an admin in the array.
func (*Team) RemovePriceByTournamentID ¶
RemovePriceByTournamentID removes price enity and price id from team enity with respect to tournament id.
func (*Team) RemoveTournamentID ¶
RemoveTournamentID removes a tournament Id in the TournamentId array.
func (*Team) RemoveUserID ¶
RemoveUserID removes a user Id in the UserId array.
func (*Team) TournamentAcc ¶
TournamentAcc returns the accury of a given team and for a given tournament.
func (*Team) Tournaments ¶
func (t *Team) Tournaments(c appengine.Context) []*Tournament
Tournaments return an array of tournament the team is involved in.
func (*Team) UpdateAccuracy ¶
UpdateAccuracy updates the global accuracy for team, with new accuracy and accuracies of other tournaments. From all accuracies of tournaments the team participates on we sum the overall accuracies. Overall accuracy is it's last element in the array of accuracies. We then normalize by the number of tournaments the teams participates on.
type TeamByAccuracy ¶
type TeamByAccuracy []*Team
TeamByAccuracy holds array of teams sorted by their accuracy
func (TeamByAccuracy) Len ¶
func (a TeamByAccuracy) Len() int
func (TeamByAccuracy) Less ¶
func (a TeamByAccuracy) Less(i, j int) bool
func (TeamByAccuracy) Swap ¶
func (a TeamByAccuracy) Swap(i, j int)
type TeamInvertedIndex ¶
TeamInvertedIndex holds informations needed for Team indexing.
func CreateTeamInvertedIndex ¶
func CreateTeamInvertedIndex(c appengine.Context, word string, teamIds string) (*TeamInvertedIndex, error)
CreateTeamInvertedIndex creates a teaminvertedindex entity given a word and a list of ids as a string.
func FindTeamInvertedIndex ¶
func FindTeamInvertedIndex(c appengine.Context, filter string, value interface{}) (*TeamInvertedIndex, error)
FindTeamInvertedIndex looks for an entity in the datastore given a filter and a value .
type TeamInvertedIndexJSON ¶
type TeamInvertedIndexJSON struct { Id *int64 `json:",omitempty"` KeyName *string `json:",omitempty"` TeamIds *[]byte `json:",omitempty"` }
TeamInvertedIndexJSON is the JSON representation of TeamInvertedIndex.
type TeamJSON ¶
type TeamJSON struct { Id *int64 `json:",omitempty"` KeyName *string `json:",omitempty"` Name *string `json:",omitempty"` Description *string `json:",omitempty"` AdminIds *[]int64 `json:",omitempty"` Private *bool `json:",omitempty"` Created *time.Time `json:",omitempty"` UserIds *[]int64 `json:",omitempty"` TournamentIds *[]int64 `json:",omitempty"` Accuracy *float64 `json:",omitempty"` AccOfTournaments *[]AccOfTournaments `json:",omitempty"` PriceIds *[]int64 `json:",omitempty"` MembersCount *int64 `json:",omitempty"` }
TeamJSON is the JSON version of the Team struct.
type TeamRequest ¶
type TeamRequest struct { Id int64 TeamId int64 TeamName string UserId int64 UserName string Created time.Time }
TeamRequest represents a request to join a team.
func CreateTeamRequest ¶
func CreateTeamRequest(c appengine.Context, teamID int64, teamName string, userID int64, userName string) (*TeamRequest, error)
CreateTeamRequest creates a teamrequest with params teamid and userid.
func FindTeamRequest ¶
func FindTeamRequest(c appengine.Context, filter string, value interface{}) []*TeamRequest
FindTeamRequest searches for all TeamRequest entities with respect of a filter and a value.
func TeamRequestByID ¶
func TeamRequestByID(c appengine.Context, id int64) (*TeamRequest, error)
TeamRequestByID returns a teamrequest if it exist given a teamrequestid.
func TeamsRequests ¶
func TeamsRequests(c appengine.Context, teams []*Team) []*TeamRequest
TeamsRequests returns an array of teamRequest entities from an array of teams.
type TeamRequestJSON ¶
type TeamRequestJSON struct { Id *int64 `json:",omitempty"` TeamId *int64 `json:",omitempty"` TeamName *string `json:",omitempty"` UserId *int64 `json:",omitempty"` UserName *string `json:",omitempty"` Created *time.Time `json:",omitempty"` }
TeamRequestJSON is JSON representation of the TeamRequest entity.
type Tgroup ¶
type Tgroup struct { Id int64 Name string Teams []Tteam Matches []Tmatch Points []int64 GoalsF []int64 GoalsA []int64 }
Tgroup represents the group of teams of a tournament
type Tmatch ¶
type Tmatch struct { Id int64 // datastore match id IdNumber int64 // id of match in tournament Date time.Time // date of match TeamId1 int64 // id of 1st team TeamId2 int64 // id of 2nd team Location string // match location Rule string // we use this field to store a specific match rule. Result1 int64 // result of 1st team Result2 int64 // result of 2nd team Finished bool // is match finished Ready bool // is match ready for predictions. CanPredict bool // can user make a prediction (used to block predictions when match has started). }
Tmatch represents a tournament match.
func GetAllMatchesFromTournament ¶
func GetAllMatchesFromTournament(c appengine.Context, tournament *Tournament) []*Tmatch
GetAllMatchesFromTournament gets an array of all matches of a tournament.
func GetMatchByIDNumber ¶
func GetMatchByIDNumber(c appengine.Context, tournament Tournament, matchInternalID int64) *Tmatch
GetMatchByIDNumber gets match entity by iDNumber.
func GetMatchesByPhase ¶
func GetMatchesByPhase(c appengine.Context, t *Tournament, phaseName string) []*Tmatch
GetMatchesByPhase gets all matches of a specific phase.
type Tournament ¶
type Tournament struct { Id int64 KeyName string Name string Description string Start time.Time End time.Time AdminIds []int64 // ids of User that are admins of the team Created time.Time GroupIds []int64 Matches1stStage []int64 Matches2ndStage []int64 UserIds []int64 TeamIds []int64 TwoLegged bool IsFirstStageComplete bool Official bool }
Tournament holds tournament entity data.
func CreateChampionsLeague ¶
func CreateChampionsLeague(c appengine.Context, adminID int64) (*Tournament, error)
CreateChampionsLeague create champions league tournament entity 2016.
func CreateChampionsLeague20152016 ¶
func CreateChampionsLeague20152016(c appengine.Context, adminId int64) (*Tournament, error)
Create champions league tournament entity 2015-2016.
func CreateCopaAmerica ¶
func CreateCopaAmerica(c appengine.Context, adminID int64) (*Tournament, error)
CreateCopaAmerica create Copa America tournament entity 2015.
func CreateCopaAmerica2016 ¶
func CreateCopaAmerica2016(c appengine.Context, adminID int64) (*Tournament, error)
CreateCopaAmerica create Copa America tournament entity 2016.
func CreateEuro2016 ¶
func CreateEuro2016(c appengine.Context, adminID int64) (*Tournament, error)
CreateEuro2016 creates euro 2016 tournament.
func CreateTournament ¶
func CreateTournament(c appengine.Context, name string, description string, start time.Time, end time.Time, adminID int64) (*Tournament, error)
CreateTournament creates tournament entity given a name and description.
func CreateWorldCup ¶
func CreateWorldCup(c appengine.Context, adminID int64) (*Tournament, error)
CreateWorldCup creates world cup tournament entity 2014.
func CreateWorldCup2018 ¶
func CreateWorldCup2018(c appengine.Context, adminID int64) (*Tournament, error)
CreateWorldCup2018 creates world cup tournament entity 2018.
func FindAllTournaments ¶
func FindAllTournaments(c appengine.Context, count, page int64) []*Tournament
FindAllTournaments finds all tournaments in the datastore.
func FindTournaments ¶
func FindTournaments(c appengine.Context, filter string, value interface{}) []*Tournament
FindTournaments finds all entity tournaments with respect of a filter and value.
func TournamentByID ¶
func TournamentByID(c appengine.Context, id int64) (*Tournament, error)
TournamentByID gets a pointer to a tournament given a tournament id.
func TournamentsByIds ¶
func TournamentsByIds(c appengine.Context, ids []int64) ([]*Tournament, error)
TournamentsByIds finds all tournaments with respect to array of ids.
func (*Tournament) AddAdmin ¶
func (t *Tournament) AddAdmin(c appengine.Context, id int64) error
AddAdmin sdds user to admins of current tournament. In order to be an admin of a tournament you should first be a member of the tournament.
func (*Tournament) AddTeamID ¶
func (t *Tournament) AddTeamID(c appengine.Context, tID int64) error
AddTeamID adds a team Id in the TeamId array.
func (*Tournament) AddUserID ¶
func (t *Tournament) AddUserID(c appengine.Context, uID int64) error
AddUserID adds a user Id in the UserId array.
func (*Tournament) AddUserIDs ¶
func (t *Tournament) AddUserIDs(c appengine.Context, uIds []int64) error
AddUserIDs adds user ids in the tournament entity.
func (*Tournament) ContainsAdminID ¶
func (t *Tournament) ContainsAdminID(id int64) (bool, int)
ContainsAdminID checks if user is admin of team.
func (*Tournament) ContainsTeamID ¶
func (t *Tournament) ContainsTeamID(id int64) (bool, int)
ContainsTeamID checks if a team is part of a tournament.
func (*Tournament) ContainsUserID ¶
func (t *Tournament) ContainsUserID(id int64) (bool, int)
ContainsUserID checks if user is part of the tournament.
func (*Tournament) Destroy ¶
func (t *Tournament) Destroy(c appengine.Context) error
Destroy a tournament entity given a tournament id.
func (*Tournament) Entity ¶
func (t *Tournament) Entity() ActivityEntity
Entity is the Activity entity representation of a tournament.
func (*Tournament) IsMatchInGroup ¶
IsMatchInGroup checks if the match is part of a group phase in the current tournament.
func (*Tournament) Join ¶
func (t *Tournament) Join(c appengine.Context, u *User) error
Join let a user join a tournament.
func (*Tournament) Joined ¶
func (t *Tournament) Joined(c appengine.Context, u *User) bool
Joined checks if a user has joined a tournament.
func (*Tournament) OldMatches ¶
func (t *Tournament) OldMatches(c appengine.Context) int
OldMatches gets the number of matches in a tournament that are finished.
func (*Tournament) Participants ¶
func (t *Tournament) Participants(c appengine.Context) []*User
Participants returns an array, from the tournament, of the users that participate in it.
func (*Tournament) Progress ¶
func (t *Tournament) Progress(c appengine.Context) float64
Progress is the progression of the tournament. The progression is a number between 0 and 1 with the progression of the tournament with respect of today's date and start and end date of tournament.
func (*Tournament) Publish ¶
func (t *Tournament) Publish(c appengine.Context, activityType string, verb string, object ActivityEntity, target ActivityEntity) error
Publish tournament activity.
func (*Tournament) RankingByTeam ¶
func (t *Tournament) RankingByTeam(c appengine.Context, limit int) []*Team
RankingByTeam ranks teams with respect ot their accuracy in the current tournament.
func (*Tournament) RankingByUser ¶
func (t *Tournament) RankingByUser(c appengine.Context, limit int) []*User
RankingByUser ranks users with respect to their score in current tournament. Sets the user score to the current tournament score and return array of users sorted by that score.
func (*Tournament) RemoveAdmin ¶
func (t *Tournament) RemoveAdmin(c appengine.Context, id int64) error
RemoveAdmin removes user of admins array in current tournament. In order to remove an admin from a team, there should be at least an admin in the array.
func (*Tournament) RemoveTeamID ¶
func (t *Tournament) RemoveTeamID(c appengine.Context, tID int64) error
RemoveTeamID adds a team Id in the TeamId array.
func (*Tournament) RemoveUserID ¶
func (t *Tournament) RemoveUserID(c appengine.Context, uID int64) error
RemoveUserID removes a user Id in the UserId array.
func (*Tournament) Reset ¶
func (t *Tournament) Reset(c appengine.Context) error
Reset tournament values: Points, GoalsF, GoalsA to zero.
func (*Tournament) TeamJoin ¶
func (t *Tournament) TeamJoin(c appengine.Context, team *Team) error
TeamJoin joins a teams to the Tournament.
func (*Tournament) TeamJoined ¶
func (t *Tournament) TeamJoined(c appengine.Context, team *Team) bool
TeamJoined checks if a Team has joined the tournament.
func (*Tournament) TeamLeave ¶
func (t *Tournament) TeamLeave(c appengine.Context, team *Team) error
TeamLeave leaves a team from the Tournament.
func (*Tournament) Teams ¶
func (t *Tournament) Teams(c appengine.Context) []*Team
Teams returns an array of teams involved in tournament, from a tournament.
func (*Tournament) Update ¶
func (t *Tournament) Update(c appengine.Context) error
Update a tournament given a tournament id and a tournament pointer.
func (*Tournament) UpdateTeamsAccuracy ¶
func (t *Tournament) UpdateTeamsAccuracy(c appengine.Context, m *Tmatch) error
UpdateTeamsAccuracy updates the accuracy of the teams members in a specific tournament.
func (*Tournament) UpdateTournamentTeam ¶
func (t *Tournament) UpdateTournamentTeam(c appengine.Context, phaseName, oldName, newName string) error
UpdateTournamentTeam updates a tournament team. From a phase an old name and a new, update the next phases of the tournament.
func (*Tournament) UpdateUsersScore ¶
func (t *Tournament) UpdateUsersScore(c appengine.Context, m *Tmatch) error
UpdateUsersScore updates the score of the participants to the tournament.
type TournamentBuilder ¶
type TournamentBuilder interface { MapOfTeamCodes() map[string]string ArrayOfPhases() []string MapOfGroups() map[string][]string MapOfGroupMatches() map[string][][]string MapOf2ndRoundMatches() map[string][][]string MapOfPhaseIntervals() map[string][]int64 MapOfIDTeams(c appengine.Context, tournament *Tournament) map[int64]string }
TournamentBuilder is interface used to build a tournament
func GetTournamentBuilder ¶
func GetTournamentBuilder(t *Tournament) TournamentBuilder
GetTournamentBuilder gets the tournament builder of a given tournament.
type TournamentInvertedIndex ¶
TournamentInvertedIndex represents the indexing date for tournament.
func CreateTournamentInvertedIndex ¶
func CreateTournamentInvertedIndex(c appengine.Context, name string, tournamentIds string) (*TournamentInvertedIndex, error)
CreateTournamentInvertedIndex creates a tournament inverted index.
func FindTournamentInvertedIndex ¶
func FindTournamentInvertedIndex(c appengine.Context, filter string, value interface{}) (*TournamentInvertedIndex, error)
FindTournamentInvertedIndex returns a tournament inverted index entity given a filter and its value. Returns nil if no entity was found.
type TournamentInvertedIndexJSON ¶
type TournamentInvertedIndexJSON struct { Id *int64 `json:",omitempty"` KeyName *string `json:",omitempty"` TournamentIds *[]byte `json:",omitempty"` }
TournamentInvertedIndexJSON is the JSON representation of the TournamentInvertedIndex struct.
type TournamentJSON ¶
type TournamentJSON struct { Id *int64 `json:",omitempty"` KeyName *string `json:",omitempty"` Name *string `json:",omitempty"` Description *string `json:",omitempty"` Start *time.Time `json:",omitempty"` End *time.Time `json:",omitempty"` AdminIds *[]int64 `json:",omitempty"` Created *time.Time `json:",omitempty"` GroupIds *[]int64 `json:",omitempty"` Matches1stStage *[]int64 `json:",omitempty"` Matches2ndStage *[]int64 `json:",omitempty"` UserIds *[]int64 `json:",omitempty"` TeamIds *[]int64 `json:",omitempty"` TwoLegged *bool `json:",omitempty"` IsFirstStageComplete *bool `json:",omitempty"` Official *bool `json:",omitempty"` }
TournamentJSON is the JSON version of the Tournament struct.
type Tphase ¶
Tphase represents a tournament phase. It holds the name of the phase and the array of Tday.
func MatchesGroupByPhase ¶
func MatchesGroupByPhase(t *Tournament, matches []*Tmatch) []Tphase
MatchesGroupByPhase gets all matches grouped by phases. Returns an array of phases.
type User ¶
type User struct { Id int64 Email string Username string Name string Alias string // name to display chosen by user if requested. IsAdmin bool // is user gonawin admin. Auth string // authentication auth token PredictIds []int64 // current user predicts. ArchivedPredictInds []int64 // archived user predicts. TournamentIds []int64 // current tournament ids of user <=> tournaments user subscribed. ArchivedTournamentIds []int64 // archived tournament ids of user <=> finnished tournametns user subscribed. TeamIds []int64 // current team ids of user <=> teams user belongs to. Score int64 // overall user score. ScoreOfTournaments []ScoreOfTournament // ids of Scores for each tournament the user is participating on. ActivityIds []int64 // ids of user's activities Created time.Time }
User represents the User entity.
func CreateUser ¶
func CreateUser(c appengine.Context, email, username, name, alias string, isAdmin bool, auth string) (*User, error)
CreateUser lets you create a user entity.
func FindAllUsers ¶
FindAllUsers finds all users present in datastore.
func SigninUser ¶
func SigninUser(c appengine.Context, queryName string, email string, username string, name string) (*User, error)
SigninUser saves a user from given parameters in the datastore and return a pointer to it.
func UsersByIds ¶
UsersByIds returns an array of pointers to Users with respect to an array of ids. It only return the found users.
func (*User) AddPredictID ¶
AddPredictID adds a predict Id in the PredictId array.
func (*User) AddTournamentID ¶
AddTournamentID adds a tournament Id in the TournamentId array.
func (*User) AddTournamentScore ¶
AddTournamentScore adds accuracy to team entity and run update.
func (*User) BuildActivity ¶
func (u *User) BuildActivity(c appengine.Context, activityType string, verb string, object ActivityEntity, target ActivityEntity) *Activity
BuildActivity build an activity.
func (*User) ContainsTeamID ¶
ContainsTeamID checks if a given team id exists in the TeamId array if a user.
func (*User) ContainsTournamentID ¶
ContainsTournamentID indicates if a tournament Id exists for a user. If the tournament Id exists, its position in the slice is returned otherwise -1.
func (*User) Entity ¶
func (u *User) Entity() ActivityEntity
Entity is the Activity entity representation of an user.
func (*User) Invitations ¶
Invitations gets the invitations of a user.
func (*User) PredictFromMatchID ¶
PredictFromMatchID returns the user predictions for a specific match.
func (*User) Publish ¶
func (u *User) Publish(c appengine.Context, activityType string, verb string, object ActivityEntity, target ActivityEntity) error
Publish user activity.
func (*User) RemoveTeamID ¶
RemoveTeamID removes a team Id in the TeamId array.
func (*User) RemoveTournamentID ¶
RemoveTournamentID removes a tournament Id in the TournamentId array.
func (*User) ScoreByTournament ¶
ScoreByTournament gets the score of user with respect to tournament. If tournament not found return 0.
func (*User) ScoreForMatch ¶
ScoreForMatch returns user's score for a given match.
func (*User) TeamsByPage ¶
TeamsByPage returns an array of teams the user is involved participates from a user id.
func (*User) TournamentScore ¶
TournamentScore return user's score for a given tournament.
func (*User) Tournaments ¶
func (u *User) Tournaments(c appengine.Context) []*Tournament
Tournaments returns an array of tournament the user is involved in from a user.
func (*User) TournamentsByPage ¶
func (u *User) TournamentsByPage(c appengine.Context, count, page int64) []*Tournament
TournamentsByPage returns an array of tournaments the user is involved participates from a user id.
func (*User) TournamentsScores ¶
func (u *User) TournamentsScores(c appengine.Context) []*ScoreOverall
TournamentsScores returns an array of scoreOverall entities group by tournament.
type UserByScore ¶
type UserByScore []*User
UserByScore represents an array of users sortes by score.
func (UserByScore) Len ¶
func (a UserByScore) Len() int
func (UserByScore) Less ¶
func (a UserByScore) Less(i, j int) bool
func (UserByScore) Swap ¶
func (a UserByScore) Swap(i, j int)
type UserInvertedIndex ¶
UserInvertedIndex holds informations needed for User indexing.
func CreateUserInvertedIndex ¶
func CreateUserInvertedIndex(c appengine.Context, word string, ids string) (*UserInvertedIndex, error)
CreateUserInvertedIndex creates a userinvertedindex entity given a word and a list of ids as a string.
func FindUserInvertedIndex ¶
func FindUserInvertedIndex(c appengine.Context, filter string, value interface{}) (*UserInvertedIndex, error)
FindUserInvertedIndex looks for an entity in the datastore given a filter and a value .
type UserInvertedIndexJSON ¶
type UserInvertedIndexJSON struct { Id *int64 `json:",omitempty"` KeyName *string `json:",omitempty"` UserIds *[]byte `json:",omitempty"` }
UserInvertedIndexJSON is the JSON representation of UserInvertedIndex.
type UserJSON ¶
type UserJSON struct { Id *int64 `json:",omitempty"` Email *string `json:",omitempty"` Username *string `json:",omitempty"` Name *string `json:",omitempty"` Alias *string `json:",omitempty"` IsAdmin *bool `json:",omitempty"` Auth *string `json:",omitempty"` PredictIds *[]int64 `json:",omitempty"` ArchivedPredictInds *[]int64 `json:",omitempty"` TournamentIds *[]int64 `json:",omitempty"` ArchivedTournamentIds *[]int64 `json:",omitempty"` TeamIds *[]int64 `json:",omitempty"` Score *int64 `json:",omitempty"` ScoreOfTournaments *[]ScoreOfTournament `json:",omitempty"` ActivityIds *[]int64 `json:",omitempty"` Created *time.Time `json:",omitempty"` }
UserJSON is the JSON representation of the User entity.
type UserRequest ¶
UserRequest represents the user request entity.
func CreateUserRequest ¶
CreateUserRequest creates a user request with params teamid and userid
func FindUserRequestByTeamAndUser ¶
func FindUserRequestByTeamAndUser(c appengine.Context, teamID int64, userID int64) *UserRequest
FindUserRequestByTeamAndUser searches a request by team id and user id pair.
func FindUserRequests ¶
func FindUserRequests(c appengine.Context, filter string, value interface{}) []*UserRequest
FindUserRequests searches for all TeamRequest entities with respect of a filter and a value.
func UserRequestByID ¶
func UserRequestByID(c appengine.Context, id int64) (*UserRequest, error)
UserRequestByID returns a user request if it exist given a user request id.
type UserRequestJSON ¶
type UserRequestJSON struct { Id *int64 `json:",omitempty"` TeamId *int64 `json:",omitempty"` UserId *int64 `json:",omitempty"` Created *time.Time `json:",omitempty"` }
UserRequestJSON is JSON representation of the UserRequest structure.
type WordCountTeam ¶
type WordCountTeam struct {
Count int64
}
WordCountTeam holds a word counter for Team entities.
type WordCountTournament ¶
type WordCountTournament struct {
Count int64
}
WordCountTournament holds the word counter for tournaments.
type WordCountUser ¶
type WordCountUser struct {
Count int64
}
WordCountUser holds a word counter for User entities.
type WorldCupTournament ¶
type WorldCupTournament struct { }
WorldCupTournament represents a World Cup tournament.
func (WorldCupTournament) ArrayOfPhases ¶
func (wct WorldCupTournament) ArrayOfPhases() []string
ArrayOfPhases returns an array of the phases names of champions league tournament: (QuarterFinals, SemiFinals, Finals).
func (WorldCupTournament) MapOf2ndRoundMatches ¶
func (wct WorldCupTournament) MapOf2ndRoundMatches() map[string][][]string
MapOf2ndRoundMatches returns the Map of 2nd round matches, of the world cup tournament. key: round number, value: array of array of strings with match information ( MatchId, MatchDate, MatchTeam1, MatchTeam2, MatchLocation)
Example:
round 16:[{"1", "Jun/12/2014", "Brazil", "Croatia", "Arena de São Paulo, São Paulo"}, ...]
func (WorldCupTournament) MapOfGroupMatches ¶
func (wct WorldCupTournament) MapOfGroupMatches() map[string][][]string
MapOfGroupMatches is a map containing the matches accessible by group.
Example:
Group A:[{"1", "Jun/12/2014", "Brazil", "Croatia", "Arena de São Paulo, São Paulo"}, ...]
func (WorldCupTournament) MapOfGroups ¶
func (wct WorldCupTournament) MapOfGroups() map[string][]string
MapOfGroups is a map containing the groups of a tournament. key: group name, value: string array of teams.
func (WorldCupTournament) MapOfIDTeams ¶
func (wct WorldCupTournament) MapOfIDTeams(c appengine.Context, tournament *Tournament) map[int64]string
MapOfIDTeams builds a map of teams from tournament entity.
func (WorldCupTournament) MapOfPhaseIntervals ¶
func (wct WorldCupTournament) MapOfPhaseIntervals() map[string][]int64
MapOfPhaseIntervals builds a map with key the corresponding phase in the world cup tournament at value a tuple that represent the match number interval in which the phase take place: first stage: matches 1 to 48 Round of 16: matches 49 to 56 Quarte-finals: matches 57 to 60 Semi-finals: matches 61 to 62 Third Place: match 63 Finals: match 64
func (WorldCupTournament) MapOfTeamCodes ¶
func (wct WorldCupTournament) MapOfTeamCodes() map[string]string
MapOfTeamCodes is map containing the team codes. key: team name, value: code example: Paris Saint-Germain: PSG
example: Brazil: BR
type WorldCupTournament2018 ¶
type WorldCupTournament2018 struct { }
WorldCupTournament2018 represents a World Cup tournament.
func (WorldCupTournament2018) ArrayOfPhases ¶
func (wct WorldCupTournament2018) ArrayOfPhases() []string
ArrayOfPhases returns an array of the phases names of champions league tournament: (QuarterFinals, SemiFinals, Finals).
func (WorldCupTournament2018) MapOf2ndRoundMatches ¶
func (wct WorldCupTournament2018) MapOf2ndRoundMatches() map[string][][]string
MapOf2ndRoundMatches returns the Map of 2nd round matches, of the world cup tournament. key: round number, value: array of array of strings with match information ( MatchId, MatchDate, MatchTeam1, MatchTeam2, MatchLocation)
Example:
round 16:[{"1", "Jun/12/2014", "Brazil", "Croatia", "Arena de São Paulo, São Paulo"}, ...]
func (WorldCupTournament2018) MapOfGroupMatches ¶
func (wct WorldCupTournament2018) MapOfGroupMatches() map[string][][]string
MapOfGroupMatches is a map containing the matches accessible by group.
Example:
Group A:[{"1", "Jun/12/2014", "Brazil", "Croatia", "Arena de São Paulo, São Paulo"}, ...]
func (WorldCupTournament2018) MapOfGroups ¶
func (wct WorldCupTournament2018) MapOfGroups() map[string][]string
MapOfGroups is a map containing the groups of a tournament. key: group name, value: string array of teams.
func (WorldCupTournament2018) MapOfIDTeams ¶
func (wct WorldCupTournament2018) MapOfIDTeams(c appengine.Context, tournament *Tournament) map[int64]string
MapOfIDTeams builds a map of teams from tournament entity.
func (WorldCupTournament2018) MapOfPhaseIntervals ¶
func (wct WorldCupTournament2018) MapOfPhaseIntervals() map[string][]int64
MapOfPhaseIntervals builds a map with key the corresponding phase in the world cup tournament at value a tuple that represent the match number interval in which the phase take place: first stage: matches 1 to 48 Round of 16: matches 49 to 56 Quarte-finals: matches 57 to 60 Semi-finals: matches 61 to 62 Third Place: match 63 Finals: match 64
func (WorldCupTournament2018) MapOfTeamCodes ¶
func (wct WorldCupTournament2018) MapOfTeamCodes() map[string]string
MapOfTeamCodes is map containing the team codes. key: team name, value: code example: Paris Saint-Germain: PSG
example: Brazil: BR
Source Files
¶
- accuracy.go
- activity.go
- models.go
- predict.go
- price.go
- score.go
- search.go
- team.go
- team_invid.go
- team_request.go
- tournament.go
- tournament_championsleague.go
- tournament_championsleague2015_2016.go
- tournament_copaamerica.go
- tournament_copaamerica2016.go
- tournament_euro2016.go
- tournament_group.go
- tournament_invid.go
- tournament_match.go
- tournament_phase.go
- tournament_score.go
- tournament_team.go
- tournament_worldcup.go
- tournament_worldcup2018.go
- user.go
- user_invid.go
- user_request.go