Documentation ¶
Overview ¶
Package site publishes endpoints and handles web requests for a power-league site.
Index ¶
- Constants
- type ContextHandler
- type HandlerFunc
- type Site
- type YahooClient
- func (y *YahooClient) GetAllTeamStats(leagueKey string, week int, projection bool) ([]goff.Team, error)
- func (y *YahooClient) GetLeagueStandings(leagueKey string) (*goff.League, error)
- func (y *YahooClient) GetMatchupsForWeekRange(leagueKey string, startWeek, endWeek int) (map[int][]goff.Matchup, error)
Constants ¶
View Source
const ( // EarliestSupportedYear that fantasy leagues will be displayed for EarliestSupportedYear = 2001 // LatestSupportedYear that fantasy leagues will be displayed for LatestSupportedYear = 2020 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextHandler ¶
type ContextHandler struct { // The context being handled Context string // The function called when the context is accessed Func HandlerFunc }
ContextHandler describes a context handled by this site
type HandlerFunc ¶ added in v0.3.0
type HandlerFunc func(s *Site, w http.ResponseWriter, r *http.Request)
HandlerFunc is a handler for a given site
type Site ¶
type Site struct { // ServeMux for this site ServeMux *http.ServeMux // contains filtered or unexported fields }
Site consists of the information needed to run a power rankings site
func NewSite ¶
func NewSite( tls bool, baseContext string, staticFiles string, templatesDir string, trackingID string, s session.Manager) *Site
NewSite creates a new site
func (*Site) ContextHandler ¶
func (s *Site) ContextHandler(id string, context string, f HandlerFunc)
ContextHandler adds a new handler for this site
type YahooClient ¶
type YahooClient struct {
Client yahooGoffClient
}
YahooClient implements rankings.PowerRankingsClient
func (*YahooClient) GetAllTeamStats ¶
func (y *YahooClient) GetAllTeamStats(leagueKey string, week int, projection bool) ([]goff.Team, error)
GetAllTeamStats gets teams stats for a given week from the Yahoo fantasy football API
func (*YahooClient) GetLeagueStandings ¶ added in v0.4.0
func (y *YahooClient) GetLeagueStandings(leagueKey string) (*goff.League, error)
GetLeagueStandings gets a league containing the current standings.
func (*YahooClient) GetMatchupsForWeekRange ¶ added in v0.4.0
func (y *YahooClient) GetMatchupsForWeekRange(leagueKey string, startWeek, endWeek int) (map[int][]goff.Matchup, error)
GetMatchupsForWeekRange returns a list of matchups for each week in the requested range.
Click to show internal directories.
Click to hide internal directories.