Documentation
¶
Index ¶
- func AddOverallPlacement(results []CompetitionResult)
- func AddPlacementToCompetitionResults(results []CompetitionResult, format string)
- func AddRecordsToHistory(history *ProfileTypeResultHistory, recorders Recorders, uid int, ...)
- func CompareCompetitionResults(res1 CompetitionResult, res2 CompetitionResult, format string) int
- func ComputeBests(bests map[int]BestEntry, rows []KinchQueryRow) error
- func ComputePlacementForCompetition(rows *[]EventResultsRow, firstRowIdx int, lastRowIdx int, uid int, ...) (string, error)
- func GenerateImagesForScrambles(scrambles []string, scramblingcode string, ismbld bool, ...) ([]string, error)
- func GenerateScramblesForEvent(scramblingcode string, noOfSolves int, ismbld bool, envMap map[string]string) ([]string, error)
- func GetCompletedSolves(db *pgxpool.Pool, uid int) (int, error)
- func GetEmailByWCAID(db *pgxpool.Pool, wcaid string) (string, error)
- func GetFormattedTimes(times []string, format string, scrambles []string) ([]string, error)
- func GetNoOfCompetitions(db *pgxpool.Pool, uid int) (int, error)
- func GetScrambles(scramblingcode string, noOfSolves int, envMap map[string]string) ([]string, error)
- func GetUserByName(db *pgxpool.Pool, name string) (int, error)
- func GetUserByWCAID(db *pgxpool.Pool, wcaid string) (int, error)
- func GetUsersByCountryWithKinchScore(db *pgxpool.Pool) (map[string][]MapDataUser, string, string, error)
- func IsRecorder(recordersEntry *RecordersEntry, uid int, records *int)
- func IsRecorder2(recorders []int, uid int, records *int)
- func IsRecorder3(recorders []int, uid int) bool
- func LoadBestSingleAndAverage(db *pgxpool.Pool, resultEntries *[]ResultEntry, ismbld bool) (string, string, error)
- func ProcessRecorders(recorders map[time.Time]RecordersEntry, uid int, ismbld bool) int
- func ProcessResultEntryToLoadRank(eventResultsRow *EventResultsRow, db *pgxpool.Pool, user *User, ...) error
- func UpdateAnnouncementTags(announcement *AnnouncementState, db *pgxpool.Pool, tx pgx.Tx, ...) error
- func UpdateCompetitionEvents(competition *CompetitionData, db *pgxpool.Pool, tx pgx.Tx, ...) error
- func UpdateRecordersByDate(recorders map[time.Time]RecordersEntry, date time.Time, singleMili int, ...)
- func UpdateRecordersEntry(oldRecordersEntry *RecordersEntry, newRecordersEntry RecordersEntry, uid int, ...)
- type AdminStatsCollection
- type AnnouncementState
- func (a *AnnouncementState) AddTags(tx pgx.Tx, tag_ids []int) error
- func (a *AnnouncementState) Create(db *pgxpool.Pool, envMap map[string]string) (string, string)
- func (a *AnnouncementState) GetEmojiCounters(db *pgxpool.Pool) error
- func (a *AnnouncementState) GetTags(db *pgxpool.Pool) error
- func (a *AnnouncementState) IsRead(db *pgxpool.Pool) error
- func (a *AnnouncementState) MakeAnnouncementUnreadForEveryone(tx pgx.Tx) (string, string)
- func (a *AnnouncementState) MarkRead(db *pgxpool.Pool) error
- func (a *AnnouncementState) RemoveAllTags(db *pgxpool.Pool, tx pgx.Tx) ([]int, error)
- type AuthDetails
- type AuthorizationInfo
- type AverageInfo
- type BestEntry
- type CompetitionData
- func (c *CompetitionData) AddEvents(db *pgxpool.Pool, tx pgx.Tx, event_ids []int, envMap map[string]string) error
- func (c *CompetitionData) GenerateScrambles(envMap map[string]string) error
- func (c *CompetitionData) GetEvents(db *pgxpool.Pool) error
- func (c *CompetitionData) GetScrambles(db *pgxpool.Pool) error
- func (competition *CompetitionData) RecomputeCompetitionId()
- func (c *CompetitionData) RemoveAllEvents(db *pgxpool.Pool, tx pgx.Tx) ([]int, error)
- type CompetitionEvent
- type CompetitionEvents
- type CompetitionResult
- func GetOverallResults(db *pgxpool.Pool, cid, regionGroup, region string) ([]CompetitionResult, error)
- func GetResultsFromCompetitionFromRows(rows []EventResultsRow, db *pgxpool.Pool) ([]CompetitionResult, error)
- func GetScores(rows []KinchQueryRow, bests map[int]BestEntry, noOfEvents int, ...) ([]CompetitionResult, error)
- type CompetitionResultStruct
- type Country
- type EmojiCounter
- type EventResultsRow
- type Feature
- type FeatureCollection
- type Geometry
- type GetWCACompetitionsResponse
- type KinchQueryRow
- type ManageRolesUser
- type MapDataUser
- type MedalCollection
- type OverallQueryStruct
- type PersonalBestEntry
- type PersonalBestRanks
- type ProfileType
- func (p *ProfileType) CountRecordsInEventFromRows(eventResultsRows *[]EventResultsRow, user *User, db *pgxpool.Pool) (Recorders, error)
- func (p *ProfileType) CreateEventHistoryForUser(db *pgxpool.Pool, user *User, event CompetitionEvent, rows []EventResultsRow, ...) error
- func (p *ProfileType) Load(db *pgxpool.Pool, uid int) error
- func (p *ProfileType) LoadBasics(db *pgxpool.Pool, uid int) error
- func (p *ProfileType) LoadHistory(db *pgxpool.Pool, user *User, recorders map[int]Recorders, ...) error
- func (p *ProfileType) LoadPersonalBests(db *pgxpool.Pool, user *User, eid int) (map[int][]EventResultsRow, error)
- func (p *ProfileType) LoadRecordCollection(db *pgxpool.Pool, user *User, rows map[int][]EventResultsRow) (map[int]Recorders, error)
- type ProfileTypeBasics
- type ProfileTypeBasicsRegion
- type ProfileTypePersonalBests
- type ProfileTypeResultHistory
- type ProfileTypeResultHistoryEntry
- type Property
- type RankResultsEntry
- type RankingsEntry
- type Ranks
- type RecordCollection
- type Recorders
- type RecordersEntry
- type ResultEntry
- func (r *ResultEntry) Average(noOfSolves int, isfmc bool, scrambles []string) int
- func (r *ResultEntry) AverageFormatted(isfmc bool, scrambles []string) (string, error)
- func (r *ResultEntry) CheckFormats(isfmc bool)
- func (r *ResultEntry) Competed() bool
- func (r *ResultEntry) FinishedCompeting() (bool, error)
- func (r *ResultEntry) FormatMultiSingle(single int) string
- func (r *ResultEntry) GetBPA() (string, error)
- func (r *ResultEntry) GetCompetitionPlace(db *pgxpool.Pool) (string, error)
- func (r *ResultEntry) GetFormattedTimes(isfmc bool, scrambles []string) ([]string, error)
- func (r *ResultEntry) GetNthSolve(noOfSolves int) string
- func (r *ResultEntry) GetPreviouslySavedTimes(db *pgxpool.Pool) ([]string, error)
- func (r *ResultEntry) GetSolveIdx(s string) int
- func (r *ResultEntry) GetSolves(isfmc bool, scrambles []string) []string
- func (r *ResultEntry) GetSolvesInMiliseconds(isfmc bool, scrambles []string) []int
- func (r *ResultEntry) GetSuspicousChangeTimesHTML(previouslySavedTimes []string, noOfSolves int, ...) string
- func (r *ResultEntry) GetWPA() (string, error)
- func (r *ResultEntry) Insert(db *pgxpool.Pool) error
- func (r *ResultEntry) IsAverageOfX() bool
- func (r *ResultEntry) IsFMC() bool
- func (r *ResultEntry) IsMBLD() bool
- func (r *ResultEntry) IsSuspicous(isfmc bool, scrambles []string) bool
- func (r *ResultEntry) LoadId(db *pgxpool.Pool) error
- func (r *ResultEntry) SendSuspicousMail(c *gin.Context, db *pgxpool.Pool, envMap map[string]string, ...)
- func (r *ResultEntry) SetNthSolve(noOfSolves int, newSolveValue string)
- func (r *ResultEntry) ShowPossibleAverages() (bool, error)
- func (r *ResultEntry) Single(isfmc bool, scrambles []string) int
- func (r *ResultEntry) SingleFormatted(isfmc bool, scrambles []string) string
- func (r *ResultEntry) SuspicousChangeInResults(previouslySavedTimes []string, noOfSolves int) bool
- func (r *ResultEntry) Update(db *pgxpool.Pool, isadmin bool, isfmc bool, valid ...bool) error
- func (r *ResultEntry) Validate(db *pgxpool.Pool, isfmc bool, scrambles []string) error
- func (r *ResultEntry) ValidateMultiEntry(entry string) string
- type ResultsSingleAverageEntry
- type ResultsStatus
- type Scramble
- type ScrambleSet
- type SearchUser
- type Tag
- type UpcomingWCACompetition
- func (c *UpcomingWCACompetition) DateFormatted() string
- func (c *UpcomingWCACompetition) DeleteEvents(db pgx.Tx) error
- func (c *UpcomingWCACompetition) GetEventNamesFromCompetitionEvents(events []CompetitionEvent) []string
- func (c *UpcomingWCACompetition) GetRegistered(db pgx.Tx) error
- func (c *UpcomingWCACompetition) Save(db pgx.Tx) (pgconn.CommandTag, error)
- func (c *UpcomingWCACompetition) SaveEvents(db pgx.Tx) error
- func (c *UpcomingWCACompetition) UpdateEvents(db pgx.Tx) error
- type UpcomingWCACompetitionRegistration
- type UpdateWCAAnnouncementSubscriptionsRequestBody
- type User
- type WCACompAnnouncementSubscriptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddOverallPlacement ¶
func AddOverallPlacement(results []CompetitionResult)
func AddPlacementToCompetitionResults ¶
func AddPlacementToCompetitionResults(results []CompetitionResult, format string)
func AddRecordsToHistory ¶
func AddRecordsToHistory( history *ProfileTypeResultHistory, recorders Recorders, uid int, p *ProfileType, )
func CompareCompetitionResults ¶
func CompareCompetitionResults(res1 CompetitionResult, res2 CompetitionResult, format string) int
compares competition results by format returns: 0 - tie
< 0 - first is smaller > 0 - second is smaller
func ComputeBests ¶
func ComputeBests(bests map[int]BestEntry, rows []KinchQueryRow) error
func GetFormattedTimes ¶
func GetScrambles ¶
func GetUsersByCountryWithKinchScore ¶
func GetUsersByCountryWithKinchScore( db *pgxpool.Pool, ) (map[string][]MapDataUser, string, string, error)
returns: map of OveralResults by country, logMsg, retMsg, error
func IsRecorder ¶
func IsRecorder(recordersEntry *RecordersEntry, uid int, records *int)
func IsRecorder2 ¶
func IsRecorder3 ¶
func ProcessRecorders ¶
func ProcessResultEntryToLoadRank ¶
func ProcessResultEntryToLoadRank( eventResultsRow *EventResultsRow, db *pgxpool.Pool, user *User, results map[int]ResultsSingleAverageEntry, ismbld bool, ) error
func UpdateAnnouncementTags ¶
func UpdateCompetitionEvents ¶
func UpdateRecordersByDate ¶
func UpdateRecordersEntry ¶
func UpdateRecordersEntry( oldRecordersEntry *RecordersEntry, newRecordersEntry RecordersEntry, uid int, records *int, ismbld bool, )
Types ¶
type AdminStatsCollection ¶
type AnnouncementState ¶
type AnnouncementState struct { Id int `json:"id"` Title string `json:"title"` Content string `json:"content"` AuthorId int `json:"authorId"` AuthorWcaId string `json:"authorWcaId"` AuthorUsername string `json:"authorUsername"` Tags []Tag `json:"tags"` Read bool `json:"read"` EmojiCounters []EmojiCounter `json:"emojiCounters"` }
func (*AnnouncementState) AddTags ¶
func (a *AnnouncementState) AddTags(tx pgx.Tx, tag_ids []int) error
func (*AnnouncementState) GetEmojiCounters ¶
func (a *AnnouncementState) GetEmojiCounters(db *pgxpool.Pool) error
func (*AnnouncementState) MakeAnnouncementUnreadForEveryone ¶
func (a *AnnouncementState) MakeAnnouncementUnreadForEveryone(tx pgx.Tx) (string, string)
func (*AnnouncementState) RemoveAllTags ¶
func (a *AnnouncementState) RemoveAllTags(db *pgxpool.Pool, tx pgx.Tx) ([]int, error)
type AuthDetails ¶
func ExtractPayload ¶
func ExtractPayload(tokenString *jwt.Token) (AuthDetails, error)
func GetAuthDetailsFromHeader ¶
func GetAuthDetailsFromHeader(c *gin.Context, secretKey string) (AuthDetails, error)
func VerifyJWTToken ¶
func VerifyJWTToken(tokenString string, secretKey string) (AuthDetails, error)
type AuthorizationInfo ¶
type AuthorizationInfo struct { AccessToken string `json:"access_token"` ExpiresIn int `json:"expires_in"` WcaId string `json:"wcaid"` AvatarUrl string `json:"avatarUrl"` IsAdmin bool `json:"isadmin"` Username string `json:"username"` }
func GetAuthInfo ¶
func GetAuthInfo(code string, envMap map[string]string) (AuthorizationInfo, error)
type AverageInfo ¶
type AverageInfo struct { Single string `json:"single"` Average string `json:"average"` Times []string `json:"times"` Bpa string `json:"bpa"` Wpa string `json:"wpa"` ShowPossibleAverage bool `json:"showPossibleAverage"` FinishedCompeting bool `json:"finishedCompeting"` Place string `json:"place"` SingleRecord string `json:"singleRecord"` SingleRecordColor string `json:"singleRecordColor"` AverageRecord string `json:"averageRecord"` AverageRecordColor string `json:"averageRecordColor"` }
func (*AverageInfo) LoadRecords ¶
func (averageInfo *AverageInfo) LoadRecords(personalBestEntry ProfileTypePersonalBests)
type BestEntry ¶
func GetNewBest ¶
func GetNewBest( pBest BestEntry, resultEntry ResultEntry, noOfSolves int, scrambles []string, ) BestEntry
type CompetitionData ¶
type CompetitionData struct { Id string `json:"id"` Name string `json:"name"` Startdate time.Time `json:"startdate"` Enddate time.Time `json:"enddate"` Events []CompetitionEvent `json:"events"` Scrambles []ScrambleSet `json:"scrambles"` Results ResultEntry `json:"results"` }
func GetAllCompetitions ¶
func GetAllCompetitions(db *pgxpool.Pool) ([]CompetitionData, error)
func GetCompetitionByIdObject ¶
func GetCompetitionByIdObject(db *pgxpool.Pool, id string) (CompetitionData, error)
func IsValidTimePeriod ¶
func (*CompetitionData) GenerateScrambles ¶
func (c *CompetitionData) GenerateScrambles(envMap map[string]string) error
func (*CompetitionData) GetScrambles ¶
func (c *CompetitionData) GetScrambles(db *pgxpool.Pool) error
func (*CompetitionData) RecomputeCompetitionId ¶
func (competition *CompetitionData) RecomputeCompetitionId()
func (*CompetitionData) RemoveAllEvents ¶
func (c *CompetitionData) RemoveAllEvents(db *pgxpool.Pool, tx pgx.Tx) ([]int, error)
type CompetitionEvent ¶
type CompetitionEvent struct { Id int `json:"id"` Fulldisplayname string `json:"fulldisplayname"` Displayname string `json:"displayname"` Format string `json:"format"` Iconcode string `json:"iconcode"` Scramblingcode string `json:"scramblingcode"` }
func GetAvailableEvents ¶
func GetAvailableEvents(db *pgxpool.Pool) ([]CompetitionEvent, error)
func GetEventById ¶
func GetEventById(db *pgxpool.Pool, eventId int) (CompetitionEvent, error)
func (*CompetitionEvent) HasScrambles ¶
type CompetitionEvents ¶
type CompetitionResult ¶
type CompetitionResult struct { Place string `json:"place"` Username string `json:"username"` WcaId string `json:"wca_id"` CountryName string `json:"country_name"` CountryIso2 string `json:"country_iso2"` Single string `json:"single"` Average string `json:"average"` Times []string `json:"times"` Score string `json:"score"` UserId int `json:"-"` Comment string `json:"comment"` }
func GetOverallResults ¶
func GetOverallResults( db *pgxpool.Pool, cid, regionGroup, region string, ) ([]CompetitionResult, error)
cid = "" is for all competitions, i.e. GetRankings
func GetResultsFromCompetitionFromRows ¶
func GetResultsFromCompetitionFromRows( rows []EventResultsRow, db *pgxpool.Pool, ) ([]CompetitionResult, error)
func GetScores ¶
func GetScores( rows []KinchQueryRow, bests map[int]BestEntry, noOfEvents int, db *pgxpool.Pool, ) ([]CompetitionResult, error)
type CompetitionResultStruct ¶
type CompetitionResultStruct struct { Results []CompetitionResult `json:"results"` AnyComment bool `json:"anyComment"` }
type EmojiCounter ¶
type EventResultsRow ¶
type EventResultsRow struct { ResultEntry ResultEntry Date time.Time ContinentId string CountryId string CountryName string CountryIso2 string }
func LoadEventRows ¶
func LoadEventRows(db *pgxpool.Pool, eid int) ([]EventResultsRow, error)
type FeatureCollection ¶
type Geometry ¶
type Geometry struct { Type string `json:"type"` Coordinates []interface{} `json:"coordinates"` }
type GetWCACompetitionsResponse ¶
type GetWCACompetitionsResponse struct { Id string `json:"id"` Name string `json:"name"` Startdate string `json:"start_date"` Enddate string `json:"end_date"` RegistrationOpen time.Time `json:"registration_open"` CompetitorLimit int `json:"competitor_limit"` Url string `json:"url"` CountryIso2 string `json:"country_iso2"` VenueAddress string `json:"venue_address"` City string `json:"city"` EventIds []string `json:"event_ids"` }
type KinchQueryRow ¶
type KinchQueryRow struct { CompetitionResult CompetitionResult ResultEntry ResultEntry }
func GetKinchQueryRows ¶
func GetKinchQueryRows(rawRows pgx.Rows, db *pgxpool.Pool) ([]KinchQueryRow, error)
type ManageRolesUser ¶
type MapDataUser ¶
type MedalCollection ¶
type OverallQueryStruct ¶
func ConstructOverallResultsQuery ¶
func ConstructOverallResultsQuery(cid, regionGroup, region string) OverallQueryStruct
type PersonalBestEntry ¶
type PersonalBestRanks ¶
func GetRankFromResults ¶
func GetRankFromResults( results map[int]ResultsSingleAverageEntry, single string, average string, user *User, ) (PersonalBestRanks, error)
type ProfileType ¶
type ProfileType struct { Basics ProfileTypeBasics `json:"basics"` PersonalBests []ProfileTypePersonalBests `json:"personalBests"` MedalCollection MedalCollection `json:"medalCollection"` RecordCollection RecordCollection `json:"recordCollection"` ResultsHistory []ProfileTypeResultHistory `json:"resultsHistory"` }
func (*ProfileType) CountRecordsInEventFromRows ¶
func (p *ProfileType) CountRecordsInEventFromRows( eventResultsRows *[]EventResultsRow, user *User, db *pgxpool.Pool, ) (Recorders, error)
func (*ProfileType) CreateEventHistoryForUser ¶
func (p *ProfileType) CreateEventHistoryForUser( db *pgxpool.Pool, user *User, event CompetitionEvent, rows []EventResultsRow, recorders Recorders, ) error
func (*ProfileType) LoadBasics ¶
func (p *ProfileType) LoadBasics(db *pgxpool.Pool, uid int) error
func (*ProfileType) LoadHistory ¶
func (p *ProfileType) LoadHistory( db *pgxpool.Pool, user *User, recorders map[int]Recorders, rows map[int][]EventResultsRow, ) error
func (*ProfileType) LoadPersonalBests ¶
func (p *ProfileType) LoadPersonalBests( db *pgxpool.Pool, user *User, eid int, ) (map[int][]EventResultsRow, error)
eid = 0 - all events, eid > 0 - only event with that id
func (*ProfileType) LoadRecordCollection ¶
func (p *ProfileType) LoadRecordCollection( db *pgxpool.Pool, user *User, rows map[int][]EventResultsRow, ) (map[int]Recorders, error)
type ProfileTypeBasics ¶
type ProfileTypeBasicsRegion ¶
type ProfileTypePersonalBests ¶
type ProfileTypePersonalBests struct { EventId int `json:"eventid"` EventName string `json:"eventName"` EventIconCode string `json:"eventIconcode"` Average PersonalBestEntry `json:"average"` Single PersonalBestEntry `json:"single"` Event CompetitionEvent `json:"-"` }
func (*ProfileTypePersonalBests) ClearAverage ¶
func (p *ProfileTypePersonalBests) ClearAverage()
func (*ProfileTypePersonalBests) ClearSingle ¶
func (p *ProfileTypePersonalBests) ClearSingle()
func (*ProfileTypePersonalBests) LoadSingleAndAverage ¶
func (p *ProfileTypePersonalBests) LoadSingleAndAverage( db *pgxpool.Pool, user *User, resultEntries *[]ResultEntry, ismbld bool, ) ([]EventResultsRow, error)
type ProfileTypeResultHistory ¶
type ProfileTypeResultHistory struct { EventId int `json:"eventId"` EventName string `json:"eventName"` EventIconCode string `json:"eventIconcode"` EventFormat string `json:"eventFormat"` History []ProfileTypeResultHistoryEntry `json:"history"` }
type ProfileTypeResultHistoryEntry ¶
type ProfileTypeResultHistoryEntry struct { CompetitionId string `json:"competitionId"` CompetitionName string `json:"competitionName"` CompetitionEnddate time.Time `json:"-"` Place string `json:"place"` Single string `json:"single"` Average string `json:"average"` Solves []string `json:"solves"` SingleRecord string `json:"singleRecord"` AverageRecord string `json:"averageRecord"` SingleRecordColor string `json:"singleRecordColor"` AverageRecordColor string `json:"averageRecordColor"` }
type Property ¶
type Property struct { Name string `json:"name"` CountryIso2 string `json:"countryIso2"` Users []MapDataUser `json:"users"` }
type RankResultsEntry ¶
type RankingsEntry ¶
type RankingsEntry struct { Place string `json:"place"` Username string `json:"username"` WcaId string `json:"wca_id"` CountryISO2 string `json:"country_iso2"` CountryName string `json:"country_name"` Result string `json:"result"` CompetitionId string `json:"competitionId"` CompetitionName string `json:"competitionName"` Times []string `json:"times"` }
func (*RankingsEntry) Load ¶
func (rankingsEntry *RankingsEntry) Load(single, persons bool, resultsEntry ResultEntry, isfmc, ismbld bool, scrambles []string, rankings *[]RankingsEntry, regionType, regionPrecise string) (string, string, error)
type RecordCollection ¶
type Recorders ¶
type Recorders struct { WR map[time.Time]RecordersEntry CR map[time.Time]RecordersEntry NR map[time.Time]RecordersEntry }
type RecordersEntry ¶
type RecordersEntry struct {
// contains filtered or unexported fields
}
type ResultEntry ¶
type ResultEntry struct { Id int `json:"id"` Userid int `json:"userid"` Username string `json:"username"` WcaId string `json:"wcaid"` Competitionid string `json:"competitionid"` Competitionname string `json:"competitionname"` Eventid int `json:"eventid"` Eventname string `json:"eventname"` Iconcode string `json:"iconcode"` Format string `json:"format"` Solve1 string `json:"solve1"` Solve2 string `json:"solve2"` Solve3 string `json:"solve3"` Solve4 string `json:"solve4"` Solve5 string `json:"solve5"` Comment string `json:"comment"` Status ResultsStatus `json:"status"` BadFormat bool `json:"badFormat"` Scrambles []string `json:"-"` Email string `json:"-"` }
func GetResultEntry ¶
func GetResultEntryById ¶
func GetResultEntryById(db *pgxpool.Pool, resultId int) (ResultEntry, error)
func (*ResultEntry) Average ¶
func (r *ResultEntry) Average(noOfSolves int, isfmc bool, scrambles []string) int
func (*ResultEntry) AverageFormatted ¶
func (r *ResultEntry) AverageFormatted(isfmc bool, scrambles []string) (string, error)
func (*ResultEntry) CheckFormats ¶
func (r *ResultEntry) CheckFormats(isfmc bool)
func (*ResultEntry) Competed ¶
func (r *ResultEntry) Competed() bool
func (*ResultEntry) FinishedCompeting ¶
func (r *ResultEntry) FinishedCompeting() (bool, error)
func (*ResultEntry) FormatMultiSingle ¶
func (r *ResultEntry) FormatMultiSingle(single int) string
func (*ResultEntry) GetBPA ¶
func (r *ResultEntry) GetBPA() (string, error)
load scrambles first into resultEntry.Scrambles
func (*ResultEntry) GetCompetitionPlace ¶
func (r *ResultEntry) GetCompetitionPlace(db *pgxpool.Pool) (string, error)
func (*ResultEntry) GetFormattedTimes ¶
func (r *ResultEntry) GetFormattedTimes(isfmc bool, scrambles []string) ([]string, error)
func (*ResultEntry) GetNthSolve ¶
func (r *ResultEntry) GetNthSolve(noOfSolves int) string
func (*ResultEntry) GetPreviouslySavedTimes ¶
func (r *ResultEntry) GetPreviouslySavedTimes(db *pgxpool.Pool) ([]string, error)
func (*ResultEntry) GetSolveIdx ¶
func (r *ResultEntry) GetSolveIdx(s string) int
func (*ResultEntry) GetSolves ¶
func (r *ResultEntry) GetSolves(isfmc bool, scrambles []string) []string
func (*ResultEntry) GetSolvesInMiliseconds ¶
func (r *ResultEntry) GetSolvesInMiliseconds(isfmc bool, scrambles []string) []int
func (*ResultEntry) GetSuspicousChangeTimesHTML ¶
func (r *ResultEntry) GetSuspicousChangeTimesHTML( previouslySavedTimes []string, noOfSolves int, oldTimesFormatted, newTimesFormatted []string, ) string
func (*ResultEntry) GetWPA ¶
func (r *ResultEntry) GetWPA() (string, error)
func (*ResultEntry) IsAverageOfX ¶
func (r *ResultEntry) IsAverageOfX() bool
func (*ResultEntry) IsFMC ¶
func (r *ResultEntry) IsFMC() bool
func (*ResultEntry) IsMBLD ¶
func (r *ResultEntry) IsMBLD() bool
func (*ResultEntry) IsSuspicous ¶
func (r *ResultEntry) IsSuspicous(isfmc bool, scrambles []string) bool
func (*ResultEntry) SendSuspicousMail ¶
func (*ResultEntry) SetNthSolve ¶
func (r *ResultEntry) SetNthSolve(noOfSolves int, newSolveValue string)
func (*ResultEntry) ShowPossibleAverages ¶
func (r *ResultEntry) ShowPossibleAverages() (bool, error)
r.Format must be set
func (*ResultEntry) SingleFormatted ¶
func (r *ResultEntry) SingleFormatted(isfmc bool, scrambles []string) string
func (*ResultEntry) SuspicousChangeInResults ¶
func (r *ResultEntry) SuspicousChangeInResults(previouslySavedTimes []string, noOfSolves int) bool
func (*ResultEntry) ValidateMultiEntry ¶
func (r *ResultEntry) ValidateMultiEntry(entry string) string
type ResultsStatus ¶
type ResultsStatus struct { Id int `json:"id"` ApprovalFinished bool `json:"approvalFinished"` Approved bool `json:"approved"` Visible bool `json:"visible"` Displayname string `json:"displayname"` }
func GetAvailableResultsStatuses ¶
func GetAvailableResultsStatuses(db *pgxpool.Pool) ([]ResultsStatus, error)
func GetResultsStatus ¶
func GetResultsStatus(db *pgxpool.Pool, statusId int) (ResultsStatus, error)
type ScrambleSet ¶
type ScrambleSet struct { Event CompetitionEvent `json:"event"` Scrambles []Scramble `json:"scrambles"` }
func (*ScrambleSet) AddScramble ¶
func (s *ScrambleSet) AddScramble(scramble Scramble)
type SearchUser ¶
type SearchUser struct { Id int `json:"-"` Username string `json:"username"` WCAID string `json:"wcaid"` }
func GetUsersFromDB ¶
func GetUsersFromDB(tx pgx.Tx, query string) ([]SearchUser, int, string, string)
func (*SearchUser) CreateAnnouncementReadConnection ¶
func (u *SearchUser) CreateAnnouncementReadConnection(tx pgx.Tx, aid int) error
type UpcomingWCACompetition ¶
type UpcomingWCACompetition struct { Id string `json:"id"` Name string `json:"name"` Startdate time.Time `json:"startdate"` Enddate time.Time `json:"enddate"` Registered int `json:"registered"` RegistrationOpen time.Time `json:"registrationOpen"` CompetitorLimit int `json:"competitorLimit"` VenueAddress string `json:"venueAddress"` Url string `json:"url"` Events []CompetitionEvent `json:"events"` CountryId string `json:"-"` CountryName string `json:"-"` CountryIso2 string `json:"-"` }
func (*UpcomingWCACompetition) DateFormatted ¶
func (c *UpcomingWCACompetition) DateFormatted() string
func (*UpcomingWCACompetition) DeleteEvents ¶
func (c *UpcomingWCACompetition) DeleteEvents(db pgx.Tx) error
func (*UpcomingWCACompetition) GetEventNamesFromCompetitionEvents ¶
func (c *UpcomingWCACompetition) GetEventNamesFromCompetitionEvents( events []CompetitionEvent, ) []string
func (*UpcomingWCACompetition) GetRegistered ¶
func (c *UpcomingWCACompetition) GetRegistered(db pgx.Tx) error
func (*UpcomingWCACompetition) Save ¶
func (c *UpcomingWCACompetition) Save(db pgx.Tx) (pgconn.CommandTag, error)
func (*UpcomingWCACompetition) SaveEvents ¶
func (c *UpcomingWCACompetition) SaveEvents(db pgx.Tx) error
func (*UpcomingWCACompetition) UpdateEvents ¶
func (c *UpcomingWCACompetition) UpdateEvents(db pgx.Tx) error
type UpcomingWCACompetitionRegistration ¶
type UpcomingWCACompetitionRegistration struct {
Id int `json:"id"`
}
type User ¶
type User struct { Id int `json:"id"` Name string `json:"name"` CountryId string `json:"country_id"` ContinentId string `json:"continent_id"` Sex string `json:"sex"` WcaId string `json:"wcaid"` IsAdmin bool `json:"isadmin"` Url string `json:"url"` AvatarUrl string `json:"avatarurl"` Email string `json:"-"` }
func GetUserInfoFromWCA ¶
func GetUserInfoFromWCA(authInfo *AuthorizationInfo, envMap map[string]string) (User, error)
func (*User) CreateAllAnnouncementReadConnection ¶
Source Files
¶
- AdminStatsCollection.go
- AnnouncementState.go
- AnnouncementTags.go
- AuthDetails.go
- AuthorizationInfo.go
- AverageInfo.go
- CompetitionData.go
- CompetitionEvent.go
- CompetitionEvents.go
- CompetitionResult.go
- Country.go
- EmojiCounter.go
- FeatureCollection.go
- ManageRolesUser.go
- ProfileType.go
- RankingsEntry.go
- ResultEntry.go
- ResultsStatus.go
- ScrambleSet.go
- SearchUser.go
- Tag.go
- UpcomingWCACompetition.go
- User.go
- WCACompAnnouncementSubscription.go
Click to show internal directories.
Click to hide internal directories.