Documentation
¶
Index ¶
- Variables
- func InitSleeperClient(config SleeperConfig)
- func InitSportsFeedClient(config SportsFeedConfig)
- type APIClient
- type APIClientOptions
- type APIRequest
- type BasicAuthCredentials
- type DailyGamesNFLResponse
- type DailyGamesNFLTeamReference
- type DailyGamesNHLResponse
- type JSONUnmarshalError
- type NFLBoxScoreResponse
- type NFLBoxScoreResponseFormatted
- type NFLCurrentSeasonResponse
- type NFLCurrentWeek
- type NFLWeeklyGamesResponse
- type Sleeper
- func (d *Sleeper) GetLeague(id string) SleeperLeague
- func (d *Sleeper) GetLeagueFormatted(leagueID string) SleeperLeagueFormatted
- func (d *Sleeper) GetMatchups(league_id string, week string) []SleeperLeagueMatchup
- func (d *Sleeper) GetMatchupsFormatted(leagueID string, week string) [][]SleeperTeamFormatted
- func (d *Sleeper) GetPlayer(id string) SleeperPlayer
- func (d *Sleeper) GetRosters(league_id string) []SleeperLeagueRoster
- func (d *Sleeper) GetUsers(league_id string) []SleeperLeagueUser
- type SleeperConfig
- type SleeperLeague
- type SleeperLeagueFormatted
- type SleeperLeagueMatchup
- type SleeperLeagueMetadata
- type SleeperLeagueRoster
- type SleeperLeagueScoringSettings
- type SleeperLeagueSettings
- type SleeperLeagueUser
- type SleeperPlayer
- type SleeperPlayerFormatted
- type SleeperTeamFormatted
- type SportsFeed
- func (s *SportsFeed) FetchDailyNFLGamesInfo(date time.Time) DailyGamesNFLResponse
- func (s *SportsFeed) FetchDailyNHLGamesInfo(date time.Time) DailyGamesNHLResponse
- func (s *SportsFeed) FetchNFLBoxScore(matchup string, date time.Time) (NFLBoxScoreResponseFormatted, error)
- func (s *SportsFeed) FetchNFLCurrentSeason() NFLCurrentSeasonResponse
- func (s *SportsFeed) FetchNFLCurrentWeek() NFLCurrentWeek
- func (s *SportsFeed) FetchNFLWeeklyGames(seasonSlug string, week string) NFLWeeklyGamesResponse
- func (s *SportsFeed) FetchNFLWeeklyGamesFormatted(seasonSlug string, week string) []NFLBoxScoreResponseFormatted
- type SportsFeedConfig
- type TimeoutError
- type WeatherForecastResponse
- type WeatherRequestConfig
Constants ¶
This section is empty.
Variables ¶
var (
WeatherClientConfig = &WeatherRequestConfig{}
)
Functions ¶
func InitSleeperClient ¶
func InitSleeperClient(config SleeperConfig)
func InitSportsFeedClient ¶
func InitSportsFeedClient(config SportsFeedConfig)
Types ¶
type APIClient ¶
type APIClient struct {
// contains filtered or unexported fields
}
APIClient is the main API client type.
func NewAPIClient ¶
func NewAPIClient(options APIClientOptions) *APIClient
NewAPIClient initializes a new API client with the provided options.
func (*APIClient) Do ¶
func (c *APIClient) Do(req *APIRequest) (*http.Response, error)
Do sends the API request and returns the response. It uses exponential backoff for retries in case of transient errors.
func (*APIClient) DoAndUnmarshal ¶
func (c *APIClient) DoAndUnmarshal(req *APIRequest, v interface{}) (int, error)
DoAndUnmarshal sends a request and unmarshals the response into a provided struct
type APIClientOptions ¶
type APIClientOptions struct { BaseURL string // The base URL for API requests. BasicAuth *BasicAuthCredentials // Optional basic auth credentials. Headers map[string]string // Headers to be added to each request. Timeout time.Duration // Max time to wait for a response. RateLimit time.Duration // Duration to wait between API calls. }
APIClientOptions holds configuration options for the APIClient.
type APIRequest ¶
type APIRequest struct { Method string // HTTP method (GET, POST, etc.) Endpoint string // API endpoint, to be appended to the BaseURL. Headers map[string]string // Additional headers for this specific request. Body []byte // Request body, if applicable. }
APIRequest holds information for making API requests.
type BasicAuthCredentials ¶
BasicAuthCredentials holds basic authentication username and password.
type DailyGamesNFLResponse ¶
type DailyGamesNFLResponse struct { LastUpdatedOn time.Time `json:"lastUpdatedOn"` Games []struct { Schedule struct { ID string `json:"id"` Week int `json:"week"` StartTime time.Time `json:"startTime"` EndedTime time.Time `json:"endedTime"` AwayTeam struct { ID int `json:"id"` Abbreviation string `json:"abbreviation"` } `json:"awayTeam"` HomeTeam struct { ID int `json:"id"` Abbreviation string `json:"abbreviation"` } `json:"homeTeam"` Venue struct { ID int `json:"id"` Name string `json:"name"` } `json:"venue"` VenueAllegiance string `json:"venueAllegiance"` ScheduleStatus string `json:"scheduleStatus"` OriginalStartTime interface{} `json:"originalStartTime"` DelayedOrPostponedReason interface{} `json:"delayedOrPostponedReason"` PlayedStatus string `json:"playedStatus"` Attendance interface{} `json:"attendance"` Officials []interface{} `json:"officials"` Broadcasters []string `json:"broadcasters"` Weather interface{} `json:"weather"` } `json:"schedule"` Score struct { CurrentQuarter int `json:"currentQuarter"` CurrentQuarterSecondsRemaining int `json:"currentQuarterSecondsRemaining"` CurrentIntermission interface{} `json:"currentIntermission"` TeamInPossession interface{} `json:"teamInPossession"` CurrentDown interface{} `json:"currentDown"` CurrentYardsRemaining interface{} `json:"currentYardsRemaining"` LineOfScrimmage interface{} `json:"lineOfScrimmage"` AwayScoreTotal int `json:"awayScoreTotal"` HomeScoreTotal int `json:"homeScoreTotal"` Quarters interface{} `json:"quarters"` } `json:"score"` } `json:"games"` References struct { TeamReferences []DailyGamesNFLTeamReference `json:"teamReferences"` VenueReferences []struct { ID int `json:"id"` Name string `json:"name"` City string `json:"city"` Country string `json:"country"` GeoCoordinates struct { Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` } `json:"geoCoordinates"` CapacitiesByEventType []struct { EventType string `json:"eventType"` Capacity int `json:"capacity"` } `json:"capacitiesByEventType"` PlayingSurface string `json:"playingSurface"` BaseballDimensions []interface{} `json:"baseballDimensions"` HasRoof bool `json:"hasRoof"` HasRetractableRoof bool `json:"hasRetractableRoof"` } `json:"venueReferences"` } `json:"references"` }
DailyGamesNFLResponse represents daily NFL games response from Sportsfeed
type DailyGamesNFLTeamReference ¶
type DailyGamesNFLTeamReference struct { ID int `json:"id"` City string `json:"city"` Name string `json:"name"` Abbreviation string `json:"abbreviation"` HomeVenue struct { ID int `json:"id"` Name string `json:"name"` } `json:"homeVenue"` TeamColoursHex []string `json:"teamColoursHex"` SocialMediaAccounts []struct { MediaType string `json:"mediaType"` Value string `json:"value"` } `json:"socialMediaAccounts"` OfficialLogoImageSrc string `json:"officialLogoImageSrc"` }
type DailyGamesNHLResponse ¶
type DailyGamesNHLResponse struct { LastUpdatedOn time.Time `json:"lastUpdatedOn"` Games []struct { Schedule struct { ID int `json:"id"` StartTime time.Time `json:"startTime"` EndedTime time.Time `json:"endedTime"` AwayTeam struct { ID int `json:"id"` Abbreviation string `json:"abbreviation"` } `json:"awayTeam"` HomeTeam struct { ID int `json:"id"` Abbreviation string `json:"abbreviation"` } `json:"homeTeam"` Venue struct { ID int `json:"id"` Name string `json:"name"` } `json:"venue"` VenueAllegiance string `json:"venueAllegiance"` ScheduleStatus string `json:"scheduleStatus"` OriginalStartTime interface{} `json:"originalStartTime"` DelayedOrPostponedReason interface{} `json:"delayedOrPostponedReason"` PlayedStatus string `json:"playedStatus"` Attendance int `json:"attendance"` Officials []struct { ID int `json:"id"` Title string `json:"title"` FirstName string `json:"firstName"` LastName string `json:"lastName"` } `json:"officials"` Broadcasters []string `json:"broadcasters"` Weather struct { Type string `json:"type"` Description string `json:"description"` Wind struct { Speed struct { MilesPerHour int `json:"milesPerHour"` KilometersPerHour int `json:"kilometersPerHour"` } `json:"speed"` Direction struct { Degrees int `json:"degrees"` Label string `json:"label"` } `json:"direction"` } `json:"wind"` Temperature struct { Fahrenheit int `json:"fahrenheit"` Celsius int `json:"celsius"` } `json:"temperature"` Precipitation struct { Type interface{} `json:"type"` Percent interface{} `json:"percent"` Amount struct { Millimeters interface{} `json:"millimeters"` Centimeters interface{} `json:"centimeters"` Inches interface{} `json:"inches"` Feet interface{} `json:"feet"` } `json:"amount"` } `json:"precipitation"` HumidityPercent int `json:"humidityPercent"` } `json:"weather"` } `json:"schedule"` Score struct { CurrentPeriod interface{} `json:"currentPeriod"` CurrentPeriodSecondsRemaining int `json:"currentPeriodSecondsRemaining"` CurrentIntermission interface{} `json:"currentIntermission"` AwayScoreTotal int `json:"awayScoreTotal"` AwayShotsTotal int `json:"awayShotsTotal"` HomeScoreTotal int `json:"homeScoreTotal"` HomeShotsTotal int `json:"homeShotsTotal"` Periods []struct { PeriodNumber int `json:"periodNumber"` AwayScore int `json:"awayScore"` AwayShots int `json:"awayShots"` HomeScore int `json:"homeScore"` HomeShots int `json:"homeShots"` } `json:"periods"` } `json:"score"` } `json:"games"` References struct { TeamReferences []struct { ID int `json:"id"` City string `json:"city"` Name string `json:"name"` Abbreviation string `json:"abbreviation"` HomeVenue struct { ID int `json:"id"` Name string `json:"name"` } `json:"homeVenue"` TeamColoursHex []string `json:"teamColoursHex"` SocialMediaAccounts []struct { MediaType string `json:"mediaType"` Value string `json:"value"` } `json:"socialMediaAccounts"` OfficialLogoImageSrc string `json:"officialLogoImageSrc"` } `json:"teamReferences"` VenueReferences []struct { ID int `json:"id"` Name string `json:"name"` City string `json:"city"` Country string `json:"country"` GeoCoordinates struct { Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` } `json:"geoCoordinates"` CapacitiesByEventType []struct { EventType string `json:"eventType"` Capacity int `json:"capacity"` } `json:"capacitiesByEventType"` PlayingSurface interface{} `json:"playingSurface"` BaseballDimensions []interface{} `json:"baseballDimensions"` HasRoof bool `json:"hasRoof"` HasRetractableRoof bool `json:"hasRetractableRoof"` } `json:"venueReferences"` } `json:"references"` }
DailyGamesNHLResponse represents daily NHL games response from Sportsfeed
type JSONUnmarshalError ¶
type JSONUnmarshalError struct{ Err error }
JSONUnmarshalError is an error indicating a failure to unmarshal JSON.
func (JSONUnmarshalError) Error ¶
func (j JSONUnmarshalError) Error() string
type NFLBoxScoreResponse ¶
type NFLBoxScoreResponse struct { LastUpdatedOn time.Time `json:"lastUpdatedOn"` Game struct { ID int `json:"id"` Week int `json:"week"` StartTime time.Time `json:"startTime"` EndedTime time.Time `json:"endedTime"` AwayTeam struct { ID int `json:"id"` Abbreviation string `json:"abbreviation"` } `json:"awayTeam"` HomeTeam struct { ID int `json:"id"` Abbreviation string `json:"abbreviation"` } `json:"homeTeam"` Venue struct { ID int `json:"id"` Name string `json:"name"` } `json:"venue"` VenueAllegiance string `json:"venueAllegiance"` ScheduleStatus string `json:"scheduleStatus"` OriginalStartTime interface{} `json:"originalStartTime"` DelayedOrPostponedReason interface{} `json:"delayedOrPostponedReason"` PlayedStatus string `json:"playedStatus"` Attendance interface{} `json:"attendance"` Officials []interface{} `json:"officials"` Broadcasters []string `json:"broadcasters"` Weather struct { Type string `json:"type"` Description string `json:"description"` Wind struct { Speed struct { MilesPerHour int `json:"milesPerHour"` KilometersPerHour int `json:"kilometersPerHour"` } `json:"speed"` Direction struct { Degrees int `json:"degrees"` Label string `json:"label"` } `json:"direction"` } `json:"wind"` Temperature struct { Fahrenheit int `json:"fahrenheit"` Celsius int `json:"celsius"` } `json:"temperature"` Precipitation struct { Type interface{} `json:"type"` Percent interface{} `json:"percent"` Amount struct { Millimeters interface{} `json:"millimeters"` Centimeters interface{} `json:"centimeters"` Inches interface{} `json:"inches"` Feet interface{} `json:"feet"` } `json:"amount"` } `json:"precipitation"` HumidityPercent int `json:"humidityPercent"` } `json:"weather"` } `json:"game"` Scoring struct { CurrentQuarter int `json:"currentQuarter"` CurrentQuarterSecondsRemaining int `json:"currentQuarterSecondsRemaining"` CurrentIntermission interface{} `json:"currentIntermission"` TeamInPossession struct { ID int `json:"id"` Abbreviation string `json:"abbreviation"` } `json:"teamInPossession"` CurrentDown int `json:"currentDown"` CurrentYardsRemaining int `json:"currentYardsRemaining"` LineOfScrimmage struct { Team struct { ID int `json:"id"` Abbreviation string `json:"abbreviation"` } `json:"team"` YardLine int `json:"yardLine"` } `json:"lineOfScrimmage"` AwayScoreTotal int `json:"awayScoreTotal"` HomeScoreTotal int `json:"homeScoreTotal"` Quarters []struct { QuarterNumber int `json:"quarterNumber"` AwayScore int `json:"awayScore"` HomeScore int `json:"homeScore"` ScoringPlays []struct { QuarterSecondsElapsed int `json:"quarterSecondsElapsed"` Team struct { ID int `json:"id"` Abbreviation string `json:"abbreviation"` } `json:"team"` ScoreChange int `json:"scoreChange"` AwayScore int `json:"awayScore"` HomeScore int `json:"homeScore"` PlayDescription string `json:"playDescription"` } `json:"scoringPlays"` } `json:"quarters"` } `json:"scoring"` Stats struct { Away struct { TeamStats []struct { Passing struct { PassAttempts int `json:"passAttempts"` PassCompletions int `json:"passCompletions"` PassPct float64 `json:"passPct"` PassGrossYards int `json:"passGrossYards"` PassNetYards int `json:"passNetYards"` PassAvg float64 `json:"passAvg"` PassYardsPerAtt float64 `json:"passYardsPerAtt"` PassTD int `json:"passTD"` PassTDPct float64 `json:"passTDPct"` PassInt int `json:"passInt"` PassIntPct float64 `json:"passIntPct"` PassLng int `json:"passLng"` Pass20Plus int `json:"pass20Plus"` Pass40Plus int `json:"pass40Plus"` PassSacks int `json:"passSacks"` PassSackY int `json:"passSackY"` QbRating float64 `json:"qbRating"` } `json:"passing"` Rushing struct { RushAttempts int `json:"rushAttempts"` RushYards int `json:"rushYards"` RushAverage float64 `json:"rushAverage"` RushTD int `json:"rushTD"` RushLng int `json:"rushLng"` Rush1StDowns int `json:"rush1stDowns"` Rush1StDownsPct float64 `json:"rush1stDownsPct"` Rush20Plus int `json:"rush20Plus"` Rush40Plus int `json:"rush40Plus"` RushFumbles int `json:"rushFumbles"` } `json:"rushing"` Receiving struct { Receptions int `json:"receptions"` RecYards int `json:"recYards"` RecAverage float64 `json:"recAverage"` RecTD int `json:"recTD"` RecLng int `json:"recLng"` Rec1StDowns int `json:"rec1stDowns"` Rec20Plus int `json:"rec20Plus"` Rec40Plus int `json:"rec40Plus"` RecFumbles int `json:"recFumbles"` } `json:"receiving"` Tackles struct { TackleSolo int `json:"tackleSolo"` TackleTotal int `json:"tackleTotal"` TackleAst int `json:"tackleAst"` Sacks int `json:"sacks"` SackYds int `json:"sackYds"` TacklesForLoss int `json:"tacklesForLoss"` } `json:"tackles"` Interceptions struct { Interceptions int `json:"interceptions"` IntTD int `json:"intTD"` IntYds int `json:"intYds"` IntAverage float64 `json:"intAverage"` IntLng int `json:"intLng"` PassesDefended int `json:"passesDefended"` Stuffs int `json:"stuffs"` StuffYds int `json:"stuffYds"` KB int `json:"kB"` Safeties int `json:"safeties"` } `json:"interceptions"` Fumbles struct { Fumbles int `json:"fumbles"` FumLost int `json:"fumLost"` FumForced int `json:"fumForced"` FumOwnRec int `json:"fumOwnRec"` FumOppRec int `json:"fumOppRec"` FumRecYds int `json:"fumRecYds"` FumTotalRec int `json:"fumTotalRec"` FumTD int `json:"fumTD"` } `json:"fumbles"` KickoffReturns struct { KrRet int `json:"krRet"` KrYds int `json:"krYds"` KrAvg float64 `json:"krAvg"` KrLng int `json:"krLng"` KrTD int `json:"krTD"` Kr20Plus int `json:"kr20Plus"` Kr40Plus int `json:"kr40Plus"` KrFC int `json:"krFC"` KrFum int `json:"krFum"` } `json:"kickoffReturns"` PuntReturns struct { PrRet int `json:"prRet"` PrYds int `json:"prYds"` PrAvg float64 `json:"prAvg"` PrLng int `json:"prLng"` PrTD int `json:"prTD"` Pr20Plus int `json:"pr20Plus"` Pr40Plus int `json:"pr40Plus"` PrFC int `json:"prFC"` PrFum int `json:"prFum"` } `json:"puntReturns"` FieldGoals struct { FgBlk int `json:"fgBlk"` FgMade int `json:"fgMade"` FgAtt int `json:"fgAtt"` FgPct float64 `json:"fgPct"` FgMade119 int `json:"fgMade1_19"` FgAtt119 int `json:"fgAtt1_19"` Fg119Pct float64 `json:"fg1_19Pct"` FgMade2029 int `json:"fgMade20_29"` FgAtt2029 int `json:"fgAtt20_29"` Fg2029Pct float64 `json:"fg20_29Pct"` FgMade3039 int `json:"fgMade30_39"` FgAtt3039 int `json:"fgAtt30_39"` Fg3039Pct float64 `json:"fg30_39Pct"` FgMade4049 int `json:"fgMade40_49"` FgAtt4049 int `json:"fgAtt40_49"` Fg4049Pct float64 `json:"fg40_49Pct"` FgMade50Plus int `json:"fgMade50Plus"` FgAtt50Plus int `json:"fgAtt50Plus"` Fg50PlusPct float64 `json:"fg50PlusPct"` FgLng int `json:"fgLng"` } `json:"fieldGoals"` ExtraPointAttempt struct { XpBlk int `json:"xpBlk"` XpMade int `json:"xpMade"` XpAtt int `json:"xpAtt"` XpPct float64 `json:"xpPct"` FgAndXpPts int `json:"fgAndXpPts"` } `json:"extraPointAttempt"` Kickoffs struct { Kickoffs int `json:"kickoffs"` KoYds int `json:"koYds"` KoOOB int `json:"koOOB"` KoAvg float64 `json:"koAvg"` KoTB int `json:"koTB"` KoRet int `json:"koRet"` KoRetYds int `json:"koRetYds"` KoRetAvgYds float64 `json:"koRetAvgYds"` KoTD int `json:"koTD"` KoOS int `json:"koOS"` KoOSR int `json:"koOSR"` } `json:"kickoffs"` Punting struct { Punts int `json:"punts"` PuntYds int `json:"puntYds"` PuntNetYds int `json:"puntNetYds"` PuntLng int `json:"puntLng"` PuntAvg float64 `json:"puntAvg"` PuntNetAvg float64 `json:"puntNetAvg"` PuntBlk int `json:"puntBlk"` PuntOOB int `json:"puntOOB"` PuntDown int `json:"puntDown"` PuntIn20 int `json:"puntIn20"` PuntIn20Pct float64 `json:"puntIn20Pct"` PuntTB int `json:"puntTB"` PuntTBPct float64 `json:"puntTBPct"` PuntFC int `json:"puntFC"` PuntRet int `json:"puntRet"` PuntRetYds int `json:"puntRetYds"` PuntRetAvg float64 `json:"puntRetAvg"` } `json:"punting"` Miscellaneous struct { FirstDownsTotal int `json:"firstDownsTotal"` FirstDownsPass int `json:"firstDownsPass"` FirstDownsRush int `json:"firstDownsRush"` FirstDownsPenalty int `json:"firstDownsPenalty"` ThirdDowns int `json:"thirdDowns"` ThirdDownsAtt int `json:"thirdDownsAtt"` ThirdDownsPct float64 `json:"thirdDownsPct"` FourthDowns int `json:"fourthDowns"` FourthDownsAtt int `json:"fourthDownsAtt"` FourthDownsPct float64 `json:"fourthDownsPct"` Penalties int `json:"penalties"` PenaltyYds int `json:"penaltyYds"` OffensePlays int `json:"offensePlays"` OffenseYds int `json:"offenseYds"` OffenseAvgYds float64 `json:"offenseAvgYds"` TotalTD int `json:"totalTD"` } `json:"miscellaneous"` Standings struct { Wins int `json:"wins"` Losses int `json:"losses"` Ties int `json:"ties"` OtWins int `json:"otWins"` OtLosses int `json:"otLosses"` WinPct float64 `json:"winPct"` PointsFor int `json:"pointsFor"` PointsAgainst int `json:"pointsAgainst"` PointDifferential int `json:"pointDifferential"` } `json:"standings"` TwoPointAttempts struct { TwoPtAtt int `json:"twoPtAtt"` TwoPtMade int `json:"twoPtMade"` TwoPtPassAtt int `json:"twoPtPassAtt"` TwoPtPassMade int `json:"twoPtPassMade"` TwoPtRushAtt int `json:"twoPtRushAtt"` TwoPtRushMade int `json:"twoPtRushMade"` } `json:"twoPointAttempts"` SnapCounts struct { OffenseSnaps int `json:"offenseSnaps"` DefenseSnaps int `json:"defenseSnaps"` SpecialTeamSnaps int `json:"specialTeamSnaps"` } `json:"snapCounts"` } `json:"teamStats"` Players []struct { Player struct { ID int `json:"id"` FirstName string `json:"firstName"` LastName string `json:"lastName"` Position string `json:"position"` JerseyNumber int `json:"jerseyNumber"` } `json:"player"` PlayerStats []struct { Tackles struct { TackleSolo int `json:"tackleSolo"` TackleTotal int `json:"tackleTotal"` TackleAst int `json:"tackleAst"` Sacks float64 `json:"sacks"` SackYds int `json:"sackYds"` TacklesForLoss int `json:"tacklesForLoss"` } `json:"tackles"` Interceptions struct { Interceptions int `json:"interceptions"` IntTD int `json:"intTD"` IntYds int `json:"intYds"` IntAverage float64 `json:"intAverage"` IntLng int `json:"intLng"` PassesDefended int `json:"passesDefended"` Stuffs int `json:"stuffs"` StuffYds int `json:"stuffYds"` Safeties int `json:"safeties"` KB int `json:"kB"` } `json:"interceptions"` Fumbles struct { Fumbles int `json:"fumbles"` FumLost int `json:"fumLost"` FumForced int `json:"fumForced"` FumOwnRec int `json:"fumOwnRec"` FumOppRec int `json:"fumOppRec"` FumRecYds int `json:"fumRecYds"` FumTotalRec int `json:"fumTotalRec"` FumTD int `json:"fumTD"` } `json:"fumbles"` KickoffReturns struct { KrRet int `json:"krRet"` KrYds int `json:"krYds"` KrAvg float64 `json:"krAvg"` KrLng int `json:"krLng"` KrTD int `json:"krTD"` Kr20Plus int `json:"kr20Plus"` Kr40Plus int `json:"kr40Plus"` KrFC int `json:"krFC"` KrFum int `json:"krFum"` } `json:"kickoffReturns"` PuntReturns struct { PrRet int `json:"prRet"` PrYds int `json:"prYds"` PrAvg float64 `json:"prAvg"` PrLng int `json:"prLng"` PrTD int `json:"prTD"` Pr20Plus int `json:"pr20Plus"` Pr40Plus int `json:"pr40Plus"` PrFC int `json:"prFC"` PrFum int `json:"prFum"` } `json:"puntReturns"` FieldGoals struct { FgBlk int `json:"fgBlk"` FgMade int `json:"fgMade"` FgAtt int `json:"fgAtt"` FgPct float64 `json:"fgPct"` FgMade119 int `json:"fgMade1_19"` FgAtt119 int `json:"fgAtt1_19"` Fg119Pct float64 `json:"fg1_19Pct"` FgMade2029 int `json:"fgMade20_29"` FgAtt2029 int `json:"fgAtt20_29"` Fg2029Pct float64 `json:"fg20_29Pct"` FgMade3039 int `json:"fgMade30_39"` FgAtt3039 int `json:"fgAtt30_39"` Fg3039Pct float64 `json:"fg30_39Pct"` FgMade4049 int `json:"fgMade40_49"` FgAtt4049 int `json:"fgAtt40_49"` Fg4049Pct float64 `json:"fg40_49Pct"` FgMade50Plus int `json:"fgMade50Plus"` FgAtt50Plus int `json:"fgAtt50Plus"` Fg50PlusPct float64 `json:"fg50PlusPct"` FgLng int `json:"fgLng"` } `json:"fieldGoals"` ExtraPointAttempts struct { XpBlk int `json:"xpBlk"` XpMade int `json:"xpMade"` XpAtt int `json:"xpAtt"` XpPct float64 `json:"xpPct"` FgAndXpPts int `json:"fgAndXpPts"` } `json:"extraPointAttempts"` Kickoffs struct { Kickoffs int `json:"kickoffs"` KoYds int `json:"koYds"` KoOOB int `json:"koOOB"` KoAvg float64 `json:"koAvg"` KoTB int `json:"koTB"` KoRet int `json:"koRet"` KoRetYds int `json:"koRetYds"` KoRetAvgYds float64 `json:"koRetAvgYds"` KoTD int `json:"koTD"` KoOS int `json:"koOS"` KoOSR int `json:"koOSR"` } `json:"kickoffs"` Punting struct { Punts int `json:"punts"` PuntYds int `json:"puntYds"` PuntNetYds int `json:"puntNetYds"` PuntLng int `json:"puntLng"` PuntAvg float64 `json:"puntAvg"` PuntNetAvg float64 `json:"puntNetAvg"` PuntBlk int `json:"puntBlk"` PuntOOB int `json:"puntOOB"` PuntDown int `json:"puntDown"` PuntIn20 int `json:"puntIn20"` PuntIn20Pct float64 `json:"puntIn20Pct"` PuntTB int `json:"puntTB"` PuntTBPct float64 `json:"puntTBPct"` PuntFC int `json:"puntFC"` PuntRet int `json:"puntRet"` PuntRetYds int `json:"puntRetYds"` PuntRetAvg float64 `json:"puntRetAvg"` } `json:"punting"` Miscellaneous struct { GamesStarted int `json:"gamesStarted"` } `json:"miscellaneous"` SnapCounts struct { OffenseSnaps int `json:"offenseSnaps"` DefenseSnaps int `json:"defenseSnaps"` SpecialTeamSnaps int `json:"specialTeamSnaps"` } `json:"snapCounts"` } `json:"playerStats"` } `json:"players"` } `json:"away"` Home struct { TeamStats []struct { Passing struct { PassAttempts int `json:"passAttempts"` PassCompletions int `json:"passCompletions"` PassPct float64 `json:"passPct"` PassGrossYards int `json:"passGrossYards"` PassNetYards int `json:"passNetYards"` PassAvg float64 `json:"passAvg"` PassYardsPerAtt float64 `json:"passYardsPerAtt"` PassTD int `json:"passTD"` PassTDPct float64 `json:"passTDPct"` PassInt int `json:"passInt"` PassIntPct float64 `json:"passIntPct"` PassLng int `json:"passLng"` Pass20Plus int `json:"pass20Plus"` Pass40Plus int `json:"pass40Plus"` PassSacks int `json:"passSacks"` PassSackY int `json:"passSackY"` QbRating float64 `json:"qbRating"` } `json:"passing"` Rushing struct { RushAttempts int `json:"rushAttempts"` RushYards int `json:"rushYards"` RushAverage float64 `json:"rushAverage"` RushTD int `json:"rushTD"` RushLng int `json:"rushLng"` Rush1StDowns int `json:"rush1stDowns"` Rush1StDownsPct float64 `json:"rush1stDownsPct"` Rush20Plus int `json:"rush20Plus"` Rush40Plus int `json:"rush40Plus"` RushFumbles int `json:"rushFumbles"` } `json:"rushing"` Receiving struct { Receptions int `json:"receptions"` RecYards int `json:"recYards"` RecAverage float64 `json:"recAverage"` RecTD int `json:"recTD"` RecLng int `json:"recLng"` Rec1StDowns int `json:"rec1stDowns"` Rec20Plus int `json:"rec20Plus"` Rec40Plus int `json:"rec40Plus"` RecFumbles int `json:"recFumbles"` } `json:"receiving"` Tackles struct { TackleSolo int `json:"tackleSolo"` TackleTotal int `json:"tackleTotal"` TackleAst int `json:"tackleAst"` Sacks int `json:"sacks"` SackYds int `json:"sackYds"` TacklesForLoss int `json:"tacklesForLoss"` } `json:"tackles"` Interceptions struct { Interceptions int `json:"interceptions"` IntTD int `json:"intTD"` IntYds int `json:"intYds"` IntAverage float64 `json:"intAverage"` IntLng int `json:"intLng"` PassesDefended int `json:"passesDefended"` Stuffs int `json:"stuffs"` StuffYds int `json:"stuffYds"` KB int `json:"kB"` Safeties int `json:"safeties"` } `json:"interceptions"` Fumbles struct { Fumbles int `json:"fumbles"` FumLost int `json:"fumLost"` FumForced int `json:"fumForced"` FumOwnRec int `json:"fumOwnRec"` FumOppRec int `json:"fumOppRec"` FumRecYds int `json:"fumRecYds"` FumTotalRec int `json:"fumTotalRec"` FumTD int `json:"fumTD"` } `json:"fumbles"` KickoffReturns struct { KrRet int `json:"krRet"` KrYds int `json:"krYds"` KrAvg float64 `json:"krAvg"` KrLng int `json:"krLng"` KrTD int `json:"krTD"` Kr20Plus int `json:"kr20Plus"` Kr40Plus int `json:"kr40Plus"` KrFC int `json:"krFC"` KrFum int `json:"krFum"` } `json:"kickoffReturns"` PuntReturns struct { PrRet int `json:"prRet"` PrYds int `json:"prYds"` PrAvg float64 `json:"prAvg"` PrLng int `json:"prLng"` PrTD int `json:"prTD"` Pr20Plus int `json:"pr20Plus"` Pr40Plus int `json:"pr40Plus"` PrFC int `json:"prFC"` PrFum int `json:"prFum"` } `json:"puntReturns"` FieldGoals struct { FgBlk int `json:"fgBlk"` FgMade int `json:"fgMade"` FgAtt int `json:"fgAtt"` FgPct float64 `json:"fgPct"` FgMade119 int `json:"fgMade1_19"` FgAtt119 int `json:"fgAtt1_19"` Fg119Pct float64 `json:"fg1_19Pct"` FgMade2029 int `json:"fgMade20_29"` FgAtt2029 int `json:"fgAtt20_29"` Fg2029Pct float64 `json:"fg20_29Pct"` FgMade3039 int `json:"fgMade30_39"` FgAtt3039 int `json:"fgAtt30_39"` Fg3039Pct float64 `json:"fg30_39Pct"` FgMade4049 int `json:"fgMade40_49"` FgAtt4049 int `json:"fgAtt40_49"` Fg4049Pct float64 `json:"fg40_49Pct"` FgMade50Plus int `json:"fgMade50Plus"` FgAtt50Plus int `json:"fgAtt50Plus"` Fg50PlusPct float64 `json:"fg50PlusPct"` FgLng int `json:"fgLng"` } `json:"fieldGoals"` ExtraPointAttempt struct { XpBlk int `json:"xpBlk"` XpMade int `json:"xpMade"` XpAtt int `json:"xpAtt"` XpPct float64 `json:"xpPct"` FgAndXpPts int `json:"fgAndXpPts"` } `json:"extraPointAttempt"` Kickoffs struct { Kickoffs int `json:"kickoffs"` KoYds int `json:"koYds"` KoOOB int `json:"koOOB"` KoAvg float64 `json:"koAvg"` KoTB int `json:"koTB"` KoRet int `json:"koRet"` KoRetYds int `json:"koRetYds"` KoRetAvgYds float64 `json:"koRetAvgYds"` KoTD int `json:"koTD"` KoOS int `json:"koOS"` KoOSR int `json:"koOSR"` } `json:"kickoffs"` Punting struct { Punts int `json:"punts"` PuntYds int `json:"puntYds"` PuntNetYds int `json:"puntNetYds"` PuntLng int `json:"puntLng"` PuntAvg float64 `json:"puntAvg"` PuntNetAvg float64 `json:"puntNetAvg"` PuntBlk int `json:"puntBlk"` PuntOOB int `json:"puntOOB"` PuntDown int `json:"puntDown"` PuntIn20 int `json:"puntIn20"` PuntIn20Pct float64 `json:"puntIn20Pct"` PuntTB int `json:"puntTB"` PuntTBPct float64 `json:"puntTBPct"` PuntFC int `json:"puntFC"` PuntRet int `json:"puntRet"` PuntRetYds int `json:"puntRetYds"` PuntRetAvg float64 `json:"puntRetAvg"` } `json:"punting"` Miscellaneous struct { FirstDownsTotal int `json:"firstDownsTotal"` FirstDownsPass int `json:"firstDownsPass"` FirstDownsRush int `json:"firstDownsRush"` FirstDownsPenalty int `json:"firstDownsPenalty"` ThirdDowns int `json:"thirdDowns"` ThirdDownsAtt int `json:"thirdDownsAtt"` ThirdDownsPct float64 `json:"thirdDownsPct"` FourthDowns int `json:"fourthDowns"` FourthDownsAtt int `json:"fourthDownsAtt"` FourthDownsPct float64 `json:"fourthDownsPct"` Penalties int `json:"penalties"` PenaltyYds int `json:"penaltyYds"` OffensePlays int `json:"offensePlays"` OffenseYds int `json:"offenseYds"` OffenseAvgYds float64 `json:"offenseAvgYds"` TotalTD int `json:"totalTD"` } `json:"miscellaneous"` Standings struct { Wins int `json:"wins"` Losses int `json:"losses"` Ties int `json:"ties"` OtWins int `json:"otWins"` OtLosses int `json:"otLosses"` WinPct float64 `json:"winPct"` PointsFor int `json:"pointsFor"` PointsAgainst int `json:"pointsAgainst"` PointDifferential int `json:"pointDifferential"` } `json:"standings"` TwoPointAttempts struct { TwoPtAtt int `json:"twoPtAtt"` TwoPtMade int `json:"twoPtMade"` TwoPtPassAtt int `json:"twoPtPassAtt"` TwoPtPassMade int `json:"twoPtPassMade"` TwoPtRushAtt int `json:"twoPtRushAtt"` TwoPtRushMade int `json:"twoPtRushMade"` } `json:"twoPointAttempts"` SnapCounts struct { OffenseSnaps int `json:"offenseSnaps"` DefenseSnaps int `json:"defenseSnaps"` SpecialTeamSnaps int `json:"specialTeamSnaps"` } `json:"snapCounts"` } `json:"teamStats"` Players []struct { Player struct { ID int `json:"id"` FirstName string `json:"firstName"` LastName string `json:"lastName"` Position string `json:"position"` JerseyNumber int `json:"jerseyNumber"` } `json:"player"` PlayerStats []struct { Tackles struct { TackleSolo int `json:"tackleSolo"` TackleTotal int `json:"tackleTotal"` TackleAst int `json:"tackleAst"` Sacks float64 `json:"sacks"` SackYds int `json:"sackYds"` TacklesForLoss int `json:"tacklesForLoss"` } `json:"tackles"` Interceptions struct { Interceptions int `json:"interceptions"` IntTD int `json:"intTD"` IntYds int `json:"intYds"` IntAverage float64 `json:"intAverage"` IntLng int `json:"intLng"` PassesDefended int `json:"passesDefended"` Stuffs int `json:"stuffs"` StuffYds int `json:"stuffYds"` Safeties int `json:"safeties"` KB int `json:"kB"` } `json:"interceptions"` Fumbles struct { Fumbles int `json:"fumbles"` FumLost int `json:"fumLost"` FumForced int `json:"fumForced"` FumOwnRec int `json:"fumOwnRec"` FumOppRec int `json:"fumOppRec"` FumRecYds int `json:"fumRecYds"` FumTotalRec int `json:"fumTotalRec"` FumTD int `json:"fumTD"` } `json:"fumbles"` KickoffReturns struct { KrRet int `json:"krRet"` KrYds int `json:"krYds"` KrAvg float64 `json:"krAvg"` KrLng int `json:"krLng"` KrTD int `json:"krTD"` Kr20Plus int `json:"kr20Plus"` Kr40Plus int `json:"kr40Plus"` KrFC int `json:"krFC"` KrFum int `json:"krFum"` } `json:"kickoffReturns"` PuntReturns struct { PrRet int `json:"prRet"` PrYds int `json:"prYds"` PrAvg float64 `json:"prAvg"` PrLng int `json:"prLng"` PrTD int `json:"prTD"` Pr20Plus int `json:"pr20Plus"` Pr40Plus int `json:"pr40Plus"` PrFC int `json:"prFC"` PrFum int `json:"prFum"` } `json:"puntReturns"` Miscellaneous struct { GamesStarted int `json:"gamesStarted"` } `json:"miscellaneous"` SnapCounts struct { OffenseSnaps int `json:"offenseSnaps"` DefenseSnaps int `json:"defenseSnaps"` SpecialTeamSnaps int `json:"specialTeamSnaps"` } `json:"snapCounts"` } `json:"playerStats"` } `json:"players"` } `json:"home"` } `json:"stats"` References struct { TeamReferences []struct { ID int `json:"id"` City string `json:"city"` Name string `json:"name"` Abbreviation string `json:"abbreviation"` HomeVenue struct { ID int `json:"id"` Name string `json:"name"` } `json:"homeVenue"` TeamColoursHex []string `json:"teamColoursHex"` SocialMediaAccounts []struct { MediaType string `json:"mediaType"` Value string `json:"value"` } `json:"socialMediaAccounts"` OfficialLogoImageSrc string `json:"officialLogoImageSrc"` } `json:"teamReferences"` VenueReferences []struct { ID int `json:"id"` Name string `json:"name"` City string `json:"city"` Country string `json:"country"` GeoCoordinates struct { Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` } `json:"geoCoordinates"` CapacitiesByEventType []struct { EventType string `json:"eventType"` Capacity int `json:"capacity"` } `json:"capacitiesByEventType"` PlayingSurface string `json:"playingSurface"` BaseballDimensions []interface{} `json:"baseballDimensions"` HasRoof bool `json:"hasRoof"` HasRetractableRoof bool `json:"hasRetractableRoof"` } `json:"venueReferences"` PlayerReferences []struct { ID int `json:"id"` FirstName string `json:"firstName"` LastName string `json:"lastName"` PrimaryPosition string `json:"primaryPosition"` JerseyNumber int `json:"jerseyNumber"` CurrentTeam struct { ID int `json:"id"` Abbreviation string `json:"abbreviation"` } `json:"currentTeam"` CurrentRosterStatus string `json:"currentRosterStatus"` CurrentInjury interface{} `json:"currentInjury"` Height string `json:"height"` Weight int `json:"weight"` BirthDate string `json:"birthDate"` Age int `json:"age"` BirthCity interface{} `json:"birthCity"` BirthCountry interface{} `json:"birthCountry"` Rookie bool `json:"rookie"` HighSchool interface{} `json:"highSchool"` College string `json:"college"` Handedness interface{} `json:"handedness"` OfficialImageSrc string `json:"officialImageSrc"` SocialMediaAccounts []interface{} `json:"socialMediaAccounts"` } `json:"playerReferences"` PlayerStatReferences []struct { Category string `json:"category"` FullName string `json:"fullName"` Description string `json:"description"` Abbreviation string `json:"abbreviation"` Type string `json:"type"` } `json:"playerStatReferences"` TeamStatReferences []struct { Category string `json:"category"` FullName string `json:"fullName"` Description string `json:"description"` Abbreviation string `json:"abbreviation"` Type string `json:"type"` } `json:"teamStatReferences"` } `json:"references"` }
NFLBoxScoreResponse represents single NFL game box score response from Sportsfeed
type NFLBoxScoreResponseFormatted ¶
type NFLBoxScoreResponseFormatted struct { GameID string HomeAbbreviation string AwayAbbreviation string HomeScore int AwayScore int HomeLogo string AwayLogo string Quarter int QuarterMinRemaining int QuarterSecRemaining int Down int YardsRemaining int LineOfScrimmage int PlayedStatus string StartTime time.Time HomePassYards int AwayPassYards int HomeRushYards int AwayRushYards int HomeSacks int AwaySacks int HomeWins int AwayWins int HomeLosses int AwayLosses int HomeTies int AwayTies int }
NFLBoxScoreResponseFormatted formatted response for NFL box score
type NFLCurrentSeasonResponse ¶
type NFLCurrentSeasonResponse struct { LastUpdatedOn util.Date `json:"lastUpdatedOn"` Seasons []struct { Name string `json:"name"` Slug string `json:"slug"` StartDate util.Date `json:"startDate"` EndDate util.Date `json:"endDate"` SeasonInterval string `json:"seasonInterval"` SupportedTeamStats []struct { Category string `json:"category"` FullName string `json:"fullName"` Description string `json:"description"` Abbreviation string `json:"abbreviation"` Type string `json:"type"` } `json:"supportedTeamStats"` SupportedPlayerStats []struct { Category string `json:"category"` FullName string `json:"fullName"` Description string `json:"description"` Abbreviation string `json:"abbreviation"` Type string `json:"type"` } `json:"supportedPlayerStats"` Notes any `json:"notes"` } `json:"seasons"` }
NFLCurrentSeasonResponse
type NFLCurrentWeek ¶
type NFLWeeklyGamesResponse ¶
type NFLWeeklyGamesResponse struct { LastUpdatedOn time.Time `json:"lastUpdatedOn"` Games []struct { Schedule struct { ID int `json:"id"` Week int `json:"week"` StartTime time.Time `json:"startTime"` EndedTime time.Time `json:"endedTime"` AwayTeam struct { ID int `json:"id"` Abbreviation string `json:"abbreviation"` } `json:"awayTeam"` HomeTeam struct { ID int `json:"id"` Abbreviation string `json:"abbreviation"` } `json:"homeTeam"` Venue struct { ID int `json:"id"` Name string `json:"name"` } `json:"venue"` VenueAllegiance string `json:"venueAllegiance"` ScheduleStatus string `json:"scheduleStatus"` OriginalStartTime any `json:"originalStartTime"` DelayedOrPostponedReason any `json:"delayedOrPostponedReason"` PlayedStatus string `json:"playedStatus"` Attendance int `json:"attendance"` Officials []any `json:"officials"` Broadcasters []string `json:"broadcasters"` Weather struct { Type string `json:"type"` Description string `json:"description"` Wind struct { Speed struct { MilesPerHour int `json:"milesPerHour"` KilometersPerHour int `json:"kilometersPerHour"` } `json:"speed"` Direction struct { Degrees int `json:"degrees"` Label string `json:"label"` } `json:"direction"` } `json:"wind"` Temperature struct { Fahrenheit int `json:"fahrenheit"` Celsius int `json:"celsius"` } `json:"temperature"` Precipitation struct { Type string `json:"type"` Percent any `json:"percent"` Amount struct { Millimeters int `json:"millimeters"` Centimeters any `json:"centimeters"` Inches any `json:"inches"` Feet any `json:"feet"` } `json:"amount"` } `json:"precipitation"` HumidityPercent int `json:"humidityPercent"` } `json:"weather"` } `json:"schedule"` Score struct { CurrentQuarter int `json:"currentQuarter"` CurrentQuarterSecondsRemaining int `json:"currentQuarterSecondsRemaining"` CurrentIntermission any `json:"currentIntermission"` TeamInPossession any `json:"teamInPossession"` CurrentDown any `json:"currentDown"` CurrentYardsRemaining any `json:"currentYardsRemaining"` LineOfScrimmage any `json:"lineOfScrimmage"` AwayScoreTotal int `json:"awayScoreTotal"` HomeScoreTotal int `json:"homeScoreTotal"` Quarters []struct { QuarterNumber int `json:"quarterNumber"` AwayScore int `json:"awayScore"` HomeScore int `json:"homeScore"` } `json:"quarters"` } `json:"score"` } `json:"games"` TeamsWithByes []any `json:"teamsWithByes"` References struct { TeamReferences []struct { ID int `json:"id"` City string `json:"city"` Name string `json:"name"` Abbreviation string `json:"abbreviation"` HomeVenue struct { ID int `json:"id"` Name string `json:"name"` } `json:"homeVenue"` TeamColoursHex []string `json:"teamColoursHex"` SocialMediaAccounts []struct { MediaType string `json:"mediaType"` Value string `json:"value"` } `json:"socialMediaAccounts"` OfficialLogoImageSrc string `json:"officialLogoImageSrc"` } `json:"teamReferences"` VenueReferences []struct { ID int `json:"id"` Name string `json:"name"` City string `json:"city"` Country string `json:"country"` GeoCoordinates struct { Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` } `json:"geoCoordinates"` CapacitiesByEventType []struct { EventType string `json:"eventType"` Capacity int `json:"capacity"` } `json:"capacitiesByEventType"` PlayingSurface string `json:"playingSurface"` BaseballDimensions []any `json:"baseballDimensions"` HasRoof bool `json:"hasRoof"` HasRetractableRoof bool `json:"hasRetractableRoof"` } `json:"venueReferences"` } `json:"references"` }
type Sleeper ¶
type Sleeper struct {
Client *APIClient
}
func SleeperClient ¶
func SleeperClient() *Sleeper
func (*Sleeper) GetLeague ¶
func (d *Sleeper) GetLeague(id string) SleeperLeague
Fetch the league info given the league's id
func (*Sleeper) GetLeagueFormatted ¶
func (d *Sleeper) GetLeagueFormatted(leagueID string) SleeperLeagueFormatted
func (*Sleeper) GetMatchups ¶
func (d *Sleeper) GetMatchups(league_id string, week string) []SleeperLeagueMatchup
Fetch the league matchups for a given week and league id
func (*Sleeper) GetMatchupsFormatted ¶
func (d *Sleeper) GetMatchupsFormatted(leagueID string, week string) [][]SleeperTeamFormatted
func (*Sleeper) GetPlayer ¶
func (d *Sleeper) GetPlayer(id string) SleeperPlayer
Get a player's info by id Fetches data from a cached file
func (*Sleeper) GetRosters ¶
func (d *Sleeper) GetRosters(league_id string) []SleeperLeagueRoster
Fetch the league rosters for a given league id
func (*Sleeper) GetUsers ¶
func (d *Sleeper) GetUsers(league_id string) []SleeperLeagueUser
Fetch the league users for a given league id
type SleeperConfig ¶
type SleeperConfig struct {
BaseUrl string
}
type SleeperLeague ¶
type SleeperLeague struct { TotalRosters int `json:"total_rosters"` Status string `json:"status"` Sport string `json:"sport"` Shard int `json:"shard"` Settings SleeperLeagueSettings `json:"settings"` SeasonType string `json:"season_type"` Season string `json:"season"` ScoringSettings SleeperLeagueScoringSettings `json:"scoring_settings"` RosterPositions []string `json:"roster_positions"` PreviousLeagueID string `json:"previous_league_id"` Name string `json:"name"` Metadata SleeperLeagueMetadata `json:"metadata"` LoserBracketID int `json:"loser_bracket_id"` LeagueID string `json:"league_id"` LastReadID string `json:"last_read_id"` LastPinnedMessageID string `json:"last_pinned_message_id"` LastMessageTime int64 `json:"last_message_time"` LastMessageTextMap interface{} `json:"last_message_text_map"` LastMessageID string `json:"last_message_id"` LastMessageAttachment interface{} `json:"last_message_attachment"` LastAuthorIsBot bool `json:"last_author_is_bot"` LastAuthorID string `json:"last_author_id"` LastAuthorDisplayName string `json:"last_author_display_name"` LastAuthorAvatar interface{} `json:"last_author_avatar"` GroupID string `json:"group_id"` DraftID string `json:"draft_id"` CompanyID string `json:"company_id"` BracketID int `json:"bracket_id"` Avatar interface{} `json:"avatar"` }
type SleeperLeagueFormatted ¶
type SleeperLeagueMatchup ¶
type SleeperLeagueMatchup struct { StartersPoints []float64 `json:"starters_points"` Starters []string `json:"starters"` RosterID int `json:"roster_id"` Points float64 `json:"points"` PlayersPoints map[string]float64 `json:"players_points"` Players []string `json:"players"` MatchupID int `json:"matchup_id"` CustomPoints interface{} `json:"custom_points"` }
type SleeperLeagueMetadata ¶
type SleeperLeagueRoster ¶
type SleeperLeagueRoster struct { Taxi interface{} `json:"taxi"` Starters []string `json:"starters"` Settings struct { Wins int `json:"wins"` WaiverPosition int `json:"waiver_position"` WaiverBudgetUsed int `json:"waiver_budget_used"` TotalMoves int `json:"total_moves"` Ties int `json:"ties"` PptsDecimal int `json:"ppts_decimal"` Ppts int `json:"ppts"` Losses int `json:"losses"` FptsDecimal int `json:"fpts_decimal"` FptsAgainstDecimal int `json:"fpts_against_decimal"` FptsAgainst int `json:"fpts_against"` Fpts int `json:"fpts"` Division int `json:"division"` } `json:"settings"` RosterID int `json:"roster_id"` Reserve interface{} `json:"reserve"` Players []string `json:"players"` PlayerMap interface{} `json:"player_map"` OwnerID string `json:"owner_id"` Metadata struct { Streak string `json:"streak"` Record string `json:"record"` } `json:"metadata"` LeagueID string `json:"league_id"` Keepers interface{} `json:"keepers"` CoOwners interface{} `json:"co_owners"` }
type SleeperLeagueScoringSettings ¶
type SleeperLeagueScoringSettings struct { StFf float64 `json:"st_ff"` PtsAllow713 float64 `json:"pts_allow_7_13"` DefStFf float64 `json:"def_st_ff"` RecYd float64 `json:"rec_yd"` FumRecTd float64 `json:"fum_rec_td"` PtsAllow35P float64 `json:"pts_allow_35p"` PtsAllow2834 float64 `json:"pts_allow_28_34"` Fum float64 `json:"fum"` RushYd float64 `json:"rush_yd"` PassTd float64 `json:"pass_td"` BlkKick float64 `json:"blk_kick"` PassYd float64 `json:"pass_yd"` Safe float64 `json:"safe"` DefTd float64 `json:"def_td"` Fgm50P float64 `json:"fgm_50p"` DefStTd float64 `json:"def_st_td"` FumRec float64 `json:"fum_rec"` Rush2Pt float64 `json:"rush_2pt"` Xpm float64 `json:"xpm"` PtsAllow2127 float64 `json:"pts_allow_21_27"` Fgm2029 float64 `json:"fgm_20_29"` PtsAllow16 float64 `json:"pts_allow_1_6"` FumLost float64 `json:"fum_lost"` DefStFumRec float64 `json:"def_st_fum_rec"` Int float64 `json:"int"` Fgm019 float64 `json:"fgm_0_19"` PtsAllow1420 float64 `json:"pts_allow_14_20"` Rec float64 `json:"rec"` Ff float64 `json:"ff"` Fgmiss float64 `json:"fgmiss"` StFumRec float64 `json:"st_fum_rec"` Rec2Pt float64 `json:"rec_2pt"` RushTd float64 `json:"rush_td"` Xpmiss float64 `json:"xpmiss"` Fgm3039 float64 `json:"fgm_30_39"` RecTd float64 `json:"rec_td"` StTd float64 `json:"st_td"` Pass2Pt float64 `json:"pass_2pt"` PtsAllow0 float64 `json:"pts_allow_0"` PassInt float64 `json:"pass_int"` Fgm4049 float64 `json:"fgm_40_49"` Sack float64 `json:"sack"` }
type SleeperLeagueSettings ¶
type SleeperLeagueSettings struct { ReserveAllowCov int `json:"reserve_allow_cov"` ReserveSlots int `json:"reserve_slots"` Leg int `json:"leg"` OffseasonAdds int `json:"offseason_adds"` BenchLock int `json:"bench_lock"` TradeReviewDays int `json:"trade_review_days"` LeagueAverageMatch int `json:"league_average_match"` WaiverType int `json:"waiver_type"` MaxKeepers int `json:"max_keepers"` Type int `json:"type"` PickTrading int `json:"pick_trading"` DisableTrades int `json:"disable_trades"` DailyWaivers int `json:"daily_waivers"` TaxiYears int `json:"taxi_years"` TradeDeadline int `json:"trade_deadline"` VetoShowVotes int `json:"veto_show_votes"` ReserveAllowSus int `json:"reserve_allow_sus"` ReserveAllowOut int `json:"reserve_allow_out"` PlayoffRoundType int `json:"playoff_round_type"` WaiverDayOfWeek int `json:"waiver_day_of_week"` TaxiAllowVets int `json:"taxi_allow_vets"` ReserveAllowDnr int `json:"reserve_allow_dnr"` VetoAutoPoll int `json:"veto_auto_poll"` CommissionerDirectInvite int `json:"commissioner_direct_invite"` ReserveAllowDoubtful int `json:"reserve_allow_doubtful"` WaiverClearDays int `json:"waiver_clear_days"` PlayoffWeekStart int `json:"playoff_week_start"` DailyWaiversDays int `json:"daily_waivers_days"` TaxiSlots int `json:"taxi_slots"` PlayoffType int `json:"playoff_type"` DailyWaiversHour int `json:"daily_waivers_hour"` NumTeams int `json:"num_teams"` VetoVotesNeeded int `json:"veto_votes_needed"` PlayoffTeams int `json:"playoff_teams"` PlayoffSeedType int `json:"playoff_seed_type"` StartWeek int `json:"start_week"` ReserveAllowNa int `json:"reserve_allow_na"` DraftRounds int `json:"draft_rounds"` TaxiDeadline int `json:"taxi_deadline"` WaiverBidMin int `json:"waiver_bid_min"` CapacityOverride int `json:"capacity_override"` Divisions int `json:"divisions"` DisableAdds int `json:"disable_adds"` WaiverBudget int `json:"waiver_budget"` BestBall int `json:"best_ball"` }
type SleeperLeagueUser ¶
type SleeperLeagueUser struct { UserID string `json:"user_id"` Settings interface{} `json:"settings"` Metadata struct { UserMessagePn string `json:"user_message_pn"` TransactionWaiver string `json:"transaction_waiver"` TransactionTrade string `json:"transaction_trade"` TransactionFreeAgent string `json:"transaction_free_agent"` TransactionCommissioner string `json:"transaction_commissioner"` TradeBlockPn string `json:"trade_block_pn"` TeamNameUpdate string `json:"team_name_update"` TeamName string `json:"team_name"` ShowMascots string `json:"show_mascots"` PlayerNicknameUpdate string `json:"player_nickname_update"` PlayerLikePn string `json:"player_like_pn"` MentionPn string `json:"mention_pn"` MascotMessage string `json:"mascot_message"` JoinVoicePn string `json:"join_voice_pn"` Avatar string `json:"avatar"` AllowPn string `json:"allow_pn"` } `json:"metadata"` LeagueID string `json:"league_id"` IsOwner bool `json:"is_owner"` IsBot bool `json:"is_bot"` DisplayName string `json:"display_name"` Avatar interface{} `json:"avatar"` }
type SleeperPlayer ¶
type SleeperPlayer struct { Status string `json:"status"` EspnID interface{} `json:"espn_id"` College interface{} `json:"college"` SwishID interface{} `json:"swish_id"` FantasyPositions interface{} `json:"fantasy_positions"` Position string `json:"position"` FullName string `json:"full_name"` InjuryStatus interface{} `json:"injury_status"` BirthCity interface{} `json:"birth_city"` GsisID interface{} `json:"gsis_id"` RotowireID interface{} `json:"rotowire_id"` Weight string `json:"weight"` LastName string `json:"last_name"` Metadata interface{} `json:"metadata"` PracticeParticipation interface{} `json:"practice_participation"` Height string `json:"height"` InjuryNotes interface{} `json:"injury_notes"` BirthCountry interface{} `json:"birth_country"` Number int `json:"number"` Age interface{} `json:"age"` SearchRank int `json:"search_rank"` RotoworldID int `json:"rotoworld_id"` HighSchool interface{} `json:"high_school"` StatsID interface{} `json:"stats_id"` YearsExp int `json:"years_exp"` Hashtag string `json:"hashtag"` InjuryStartDate interface{} `json:"injury_start_date"` SearchLastName string `json:"search_last_name"` BirthState interface{} `json:"birth_state"` FantasyDataID int `json:"fantasy_data_id"` PracticeDescription interface{} `json:"practice_description"` InjuryBodyPart interface{} `json:"injury_body_part"` SearchFullName string `json:"search_full_name"` SportradarID string `json:"sportradar_id"` Team interface{} `json:"team"` FirstName string `json:"first_name"` DepthChartPosition interface{} `json:"depth_chart_position"` Active bool `json:"active"` PlayerID string `json:"player_id"` BirthDate interface{} `json:"birth_date"` SearchFirstName string `json:"search_first_name"` YahooID interface{} `json:"yahoo_id"` Sport string `json:"sport"` DepthChartOrder interface{} `json:"depth_chart_order"` PandascoreID interface{} `json:"pandascore_id"` NewsUpdated interface{} `json:"news_updated"` }
type SleeperPlayerFormatted ¶
type SleeperTeamFormatted ¶
type SportsFeed ¶
type SportsFeed struct {
Client *APIClient
}
func SportsFeedClient ¶
func SportsFeedClient() *SportsFeed
func (*SportsFeed) FetchDailyNFLGamesInfo ¶
func (s *SportsFeed) FetchDailyNFLGamesInfo(date time.Time) DailyGamesNFLResponse
FetchDailyNFLGamesInfo get daily NFL games response from Sportsfeed
func (*SportsFeed) FetchDailyNHLGamesInfo ¶
func (s *SportsFeed) FetchDailyNHLGamesInfo(date time.Time) DailyGamesNHLResponse
FetchDailyNHLGamesInfo get daily NHL games response from Sportsfeed
func (*SportsFeed) FetchNFLBoxScore ¶
func (s *SportsFeed) FetchNFLBoxScore(matchup string, date time.Time) (NFLBoxScoreResponseFormatted, error)
FetchNFLBoxScore Fetch info about specific NFL game from Sportsfeed
func (*SportsFeed) FetchNFLCurrentSeason ¶
func (s *SportsFeed) FetchNFLCurrentSeason() NFLCurrentSeasonResponse
func (*SportsFeed) FetchNFLCurrentWeek ¶
func (s *SportsFeed) FetchNFLCurrentWeek() NFLCurrentWeek
func (*SportsFeed) FetchNFLWeeklyGames ¶
func (s *SportsFeed) FetchNFLWeeklyGames(seasonSlug string, week string) NFLWeeklyGamesResponse
func (*SportsFeed) FetchNFLWeeklyGamesFormatted ¶
func (s *SportsFeed) FetchNFLWeeklyGamesFormatted(seasonSlug string, week string) []NFLBoxScoreResponseFormatted
type SportsFeedConfig ¶
type TimeoutError ¶
type TimeoutError struct{}
TimeoutError is an error indicating a request timeout.
func (TimeoutError) Error ¶
func (t TimeoutError) Error() string
type WeatherForecastResponse ¶
type WeatherForecastResponse struct { Location struct { Name string `json:"name"` Region string `json:"region"` Country string `json:"country"` Lat float64 `json:"lat"` Lon float64 `json:"lon"` TzID string `json:"tz_id"` LocaltimeEpoch int `json:"localtime_epoch"` Localtime string `json:"localtime"` } `json:"location"` Current struct { LastUpdatedEpoch int `json:"last_updated_epoch"` LastUpdated string `json:"last_updated"` TempC float64 `json:"temp_c"` TempF float64 `json:"temp_f"` IsDay int `json:"is_day"` Condition struct { Text string `json:"text"` Icon string `json:"icon"` Code int `json:"code"` } `json:"condition"` WindMph float64 `json:"wind_mph"` WindKph float64 `json:"wind_kph"` WindDegree int `json:"wind_degree"` WindDir string `json:"wind_dir"` PressureMb float64 `json:"pressure_mb"` PressureIn float64 `json:"pressure_in"` PrecipMm float64 `json:"precip_mm"` PrecipIn float64 `json:"precip_in"` Humidity int `json:"humidity"` Cloud int `json:"cloud"` FeelslikeC float64 `json:"feelslike_c"` FeelslikeF float64 `json:"feelslike_f"` VisKm float64 `json:"vis_km"` VisMiles float64 `json:"vis_miles"` Uv float64 `json:"uv"` GustMph float64 `json:"gust_mph"` GustKph float64 `json:"gust_kph"` } `json:"current"` Forecast struct { Forecastday []struct { Date string `json:"date"` DateEpoch int `json:"date_epoch"` Day struct { MaxtempC float64 `json:"maxtemp_c"` MaxtempF float64 `json:"maxtemp_f"` MintempC float64 `json:"mintemp_c"` MintempF float64 `json:"mintemp_f"` AvgtempC float64 `json:"avgtemp_c"` AvgtempF float64 `json:"avgtemp_f"` MaxwindMph float64 `json:"maxwind_mph"` MaxwindKph float64 `json:"maxwind_kph"` TotalprecipMm float64 `json:"totalprecip_mm"` TotalprecipIn float64 `json:"totalprecip_in"` TotalsnowCm float64 `json:"totalsnow_cm"` AvgvisKm float64 `json:"avgvis_km"` AvgvisMiles float64 `json:"avgvis_miles"` Avghumidity float64 `json:"avghumidity"` DailyWillItRain int `json:"daily_will_it_rain"` DailyChanceOfRain int `json:"daily_chance_of_rain"` DailyWillItSnow int `json:"daily_will_it_snow"` DailyChanceOfSnow int `json:"daily_chance_of_snow"` Condition struct { Text string `json:"text"` Icon string `json:"icon"` Code int `json:"code"` } `json:"condition"` Uv float64 `json:"uv"` } `json:"day"` Astro struct { Sunrise string `json:"sunrise"` Sunset string `json:"sunset"` Moonrise string `json:"moonrise"` Moonset string `json:"moonset"` MoonPhase string `json:"moon_phase"` MoonIllumination string `json:"moon_illumination"` IsMoonUp int `json:"is_moon_up"` IsSunUp int `json:"is_sun_up"` } `json:"astro"` Hour []struct { TimeEpoch int `json:"time_epoch"` Time string `json:"time"` TempC float64 `json:"temp_c"` TempF float64 `json:"temp_f"` IsDay int `json:"is_day"` Condition struct { Text string `json:"text"` Icon string `json:"icon"` Code int `json:"code"` } `json:"condition"` WindMph float64 `json:"wind_mph"` WindKph float64 `json:"wind_kph"` WindDegree int `json:"wind_degree"` WindDir string `json:"wind_dir"` PressureMb float64 `json:"pressure_mb"` PressureIn float64 `json:"pressure_in"` PrecipMm float64 `json:"precip_mm"` PrecipIn float64 `json:"precip_in"` Humidity int `json:"humidity"` Cloud int `json:"cloud"` FeelslikeC float64 `json:"feelslike_c"` FeelslikeF float64 `json:"feelslike_f"` WindchillC float64 `json:"windchill_c"` WindchillF float64 `json:"windchill_f"` HeatindexC float64 `json:"heatindex_c"` HeatindexF float64 `json:"heatindex_f"` DewpointC float64 `json:"dewpoint_c"` DewpointF float64 `json:"dewpoint_f"` WillItRain int `json:"will_it_rain"` ChanceOfRain int `json:"chance_of_rain"` WillItSnow int `json:"will_it_snow"` ChanceOfSnow int `json:"chance_of_snow"` VisKm float64 `json:"vis_km"` VisMiles float64 `json:"vis_miles"` GustMph float64 `json:"gust_mph"` GustKph float64 `json:"gust_kph"` Uv float64 `json:"uv"` } `json:"hour"` } `json:"forecastday"` } `json:"forecast"` }
func FetchWeatherForecast ¶
func FetchWeatherForecast(location string, days string) WeatherForecastResponse
type WeatherRequestConfig ¶
type WeatherRequestConfig struct {
Key string
}