Documentation ¶
Index ¶
- Constants
- type FailingSolutions
- type Golfer
- func (g *Golfer) Earn(db *sqlx.DB, cheevoID string) (earned *config.Cheevo)
- func (g *Golfer) Earned(cheevoID string) bool
- func (g *Golfer) FollowLimit() int
- func (g *Golfer) IsFollowing(userID int) bool
- func (g *Golfer) Location() (loc *time.Location)
- func (g *Golfer) SaveSettings(db *sqlx.DB)
- func (g *Golfer) Solved(holeID string) bool
- type GolferInfo
- type RankUpdate
- type RankUpdateFromTo
- type Settings
Constants ¶
View Source
const ( FollowLimit = 10 FollowLimitSponsor = 24 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FailingSolutions ¶
type FailingSolutions []struct{ Hole, Lang string }
func (*FailingSolutions) Scan ¶
func (f *FailingSolutions) Scan(src any) error
type Golfer ¶
type Golfer struct {
Admin, ShowCountry, Sponsor bool
BytesPoints, CharsPoints, ID int
Cheevos, Holes pq.StringArray
Country config.NullCountry
Delete null.Time
FailingSolutions FailingSolutions
Following pq.Int64Array
Keymap, Name, Referrer, Theme string
Pronouns, TimeZone null.String
Settings Settings
}
Golfer is the info of a logged in golfer we need on every request.
func (*Golfer) FollowLimit ¶
FollowLimit returns the max number of golfers this golfer can follow.
func (*Golfer) IsFollowing ¶
IsFollowing returns whether the golfer is following that golfer. FIXME Ideally we'd scan into a []int not a []int64 but pq won't.
func (*Golfer) SaveSettings ¶
SaveSettings saves golfer.Settings back to the DB.
type GolferInfo ¶
type GolferInfo struct { Golfer // Count of medals Diamond, Gold, Silver, Bronze int // Count of cheevos/holes/langs done Holes, Langs int // Count of cheevos/holes/langs available CheevosTotal, HolesTotal, LangsTotal int // Slice of golfers referred Referrals pq.StringArray // Start date Started time.Time }
GolferInfo is populated when looking at a /golfers/xxx route.
type RankUpdate ¶
type RankUpdate struct { Scoring string `json:"scoring"` From RankUpdateFromTo `json:"from"` To RankUpdateFromTo `json:"to"` OldBestGolferCount null.Int `json:"oldBestGolferCount"` // Number of golfers that previously held the gold medal (except current golfer). OldBestGolferID null.Int `json:"oldBestGolferID"` // ID of the golfer that previously held the diamond (except current golfer). OldBestStrokes null.Int `json:"oldBestStrokes"` // Number of strokes for previous diamond (including current golfer). OldBestSubmitted null.Time `json:"oldBestSubmitted"` // Timestamp for previous diamond (including current golfer). }
Click to show internal directories.
Click to hide internal directories.