Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertDate(date string) string
- func FixName(c string) string
- func ForecastHandler(w http.ResponseWriter, r *http.Request)
- func IndexHandler(w http.ResponseWriter, r *http.Request)
- func InitRand()
- func LoadIndex(I *Index) (error, time.Time)
- func LoadRaces(dst string, R *Races) (error, time.Time)
- func LoadSummary(dst string, S *Summary) (error, time.Time)
- func LoadURL(url string, f func(io.Reader) (interface{}, error)) (val interface{}, err error)
- func MapHandler(w http.ResponseWriter, r *http.Request)
- func RacesHandler(w http.ResponseWriter, r *http.Request)
- func RandGammaVariate(k float64) float64
- func SummaryHandler(w http.ResponseWriter, r *http.Request)
- func ValueHandler(w http.ResponseWriter, r *http.Request, name string, ...)
- func WriteForecastScript(w http.ResponseWriter)
- func WriteHtmlFooter(w http.ResponseWriter)
- func WriteHtmlHeader(w http.ResponseWriter, name string, refresh, plot, maps bool)
- func WriteHtmlLines(w http.ResponseWriter, text []string)
- func WriteHtmlScript(w http.ResponseWriter, script string)
- func WriteMapScript(w http.ResponseWriter)
- type CacheType
- type CandidateForecast
- type CombinedUpdater
- type DateRace
- type Forecast
- type Index
- type MultiUpdater
- type Race
- type Races
- type RegionCandidate
- type RegionVote
- type RegionVotePriority
- type Summary
- type SummaryCandidate
- type SummaryDefaults
- type SummaryRegion
- type SummaryVote
- type SummaryVotePriority
- type Updater
- type UpdaterDst
Constants ¶
Variables ¶
View Source
var Cache = make(map[string]CacheType)
Functions ¶
func ConvertDate ¶
func ForecastHandler ¶
func ForecastHandler(w http.ResponseWriter, r *http.Request)
func IndexHandler ¶
func IndexHandler(w http.ResponseWriter, r *http.Request)
func MapHandler ¶
func MapHandler(w http.ResponseWriter, r *http.Request)
func RacesHandler ¶
func RacesHandler(w http.ResponseWriter, r *http.Request)
func RandGammaVariate ¶
func SummaryHandler ¶
func SummaryHandler(w http.ResponseWriter, r *http.Request)
func ValueHandler ¶
func WriteForecastScript ¶
func WriteForecastScript(w http.ResponseWriter)
func WriteHtmlFooter ¶
func WriteHtmlFooter(w http.ResponseWriter)
func WriteHtmlHeader ¶
func WriteHtmlHeader(w http.ResponseWriter, name string, refresh, plot, maps bool)
func WriteHtmlLines ¶
func WriteHtmlLines(w http.ResponseWriter, text []string)
func WriteHtmlScript ¶
func WriteHtmlScript(w http.ResponseWriter, script string)
func WriteMapScript ¶
func WriteMapScript(w http.ResponseWriter)
Types ¶
type CandidateForecast ¶
type CombinedUpdater ¶
type CombinedUpdater []UpdaterDst
type Forecast ¶
type Forecast []CandidateForecast
type MultiUpdater ¶
type MultiUpdater []UpdaterDst
func (MultiUpdater) Update ¶
func (U MultiUpdater) Update(dst string) error
type RegionCandidate ¶
type RegionVote ¶
type RegionVote struct { Candidates []RegionCandidate `json:"candidates"` TotalVotes uint64 `json:"total_votes"` PortionComplete float64 `json:"portion_complete"` }
type RegionVotePriority ¶
type RegionVotePriority struct { RegionVote Priority map[string]int }
func (RegionVotePriority) Len ¶
func (S RegionVotePriority) Len() int
func (RegionVotePriority) Less ¶
func (S RegionVotePriority) Less(i, j int) bool
func (RegionVotePriority) Swap ¶
func (S RegionVotePriority) Swap(i, j int)
type Summary ¶
type Summary struct { SummaryDefaults `json:",inline"` SummaryVote `json:",inline"` Regions map[string]SummaryRegion `json:"regions,omitempty"` Forecast Forecast `json:"forecast,omitempty"` ForecastWeight float64 `json:"forecast_weight"` }
func CombineSummaries ¶
func CombineSummaries(Defaults SummaryDefaults, Ss ...Summary) Summary
func (Summary) SaveToFile ¶
type SummaryCandidate ¶
type SummaryDefaults ¶
type SummaryDefaults struct { Name string `json:"name"` PrefixText []string `json:"prefix_text"` SuffixText []string `json:"suffix_text"` VotePortionThresh float64 `json:"vote_portion_thresh"` MapPortionThresh float64 `json:"map_portion_thresh"` OddsThresh float64 `json:"odds_thresh"` GraphPortionThresh float64 `json:"graph_portion_thresh"` GraphOddsThresh float64 `json:"graph_odds_thresh"` Colors map[string]string `json:"colors"` Priority map[string]int `json:"priority"` OtherRaces Races `json:"other_races,omitempty"` ShowDate bool `json:"show_date"` ShowMap bool `json:"show_map"` }
type SummaryRegion ¶
type SummaryRegion struct { RegionVote `json:",inline"` Name string `json:"name"` Exclude bool `json:"exclude"` }
type SummaryVote ¶
type SummaryVote struct { Candidates []SummaryCandidate `json:"candidates"` TotalVotes uint64 `json:"total_votes"` PortionComplete float64 `json:"portion_complete"` }
type SummaryVotePriority ¶
type SummaryVotePriority struct { SummaryVote Priority map[string]int }
func (SummaryVotePriority) Len ¶
func (S SummaryVotePriority) Len() int
func (SummaryVotePriority) Less ¶
func (S SummaryVotePriority) Less(i, j int) bool
func (SummaryVotePriority) Swap ¶
func (S SummaryVotePriority) Swap(i, j int)
type UpdaterDst ¶
Click to show internal directories.
Click to hide internal directories.