Documentation ¶
Index ¶
- Constants
- type GameQuery
- func (g *GameQuery) Codes(codes []string) *GameQuery
- func (q *GameQuery) Delete(client *http.Client) (*schema.FantasyContent, error)
- func (g *GameQuery) GameWeeks() *GameQuery
- func (q *GameQuery) Get(client *http.Client) (*schema.FantasyContent, error)
- func (g *GameQuery) IsAvailable() *GameQuery
- func (g *GameQuery) Key(key string) *GameQuery
- func (g *GameQuery) Keys(keys []string) *GameQuery
- func (g *GameQuery) Leagues() *LeagueQuery
- func (g *GameQuery) Players() *PlayerQuery
- func (g *GameQuery) PositionTypes() *GameQuery
- func (q *GameQuery) Post(client *http.Client) (*schema.FantasyContent, error)
- func (q *GameQuery) Put(client *http.Client) (*schema.FantasyContent, error)
- func (q *GameQuery) Reset()
- func (g *GameQuery) RosterPositions() *GameQuery
- func (g *GameQuery) Seasons(seasons []int) *GameQuery
- func (g *GameQuery) StatCategories() *GameQuery
- func (g *GameQuery) Teams() *TeamQuery
- func (q *GameQuery) ToString() string
- func (g *GameQuery) Types(types []string) *GameQuery
- type LeagueQuery
- func (l *LeagueQuery) CurrentScoreboard() *LeagueQuery
- func (q *LeagueQuery) Delete(client *http.Client) (*schema.FantasyContent, error)
- func (l *LeagueQuery) DraftResults() *LeagueQuery
- func (q *LeagueQuery) Get(client *http.Client) (*schema.FantasyContent, error)
- func (l *LeagueQuery) Key(key string) *LeagueQuery
- func (l *LeagueQuery) Keys(keys []string) *LeagueQuery
- func (l *LeagueQuery) Players() *PlayerQuery
- func (l *LeagueQuery) PlayersWithDefaults() *PlayerQuery
- func (q *LeagueQuery) Post(client *http.Client) (*schema.FantasyContent, error)
- func (q *LeagueQuery) Put(client *http.Client) (*schema.FantasyContent, error)
- func (q *LeagueQuery) Reset()
- func (l *LeagueQuery) Scoreboard(week int) *LeagueQuery
- func (l *LeagueQuery) Settings() *LeagueQuery
- func (l *LeagueQuery) Standings() *LeagueQuery
- func (l *LeagueQuery) Teams() *TeamQuery
- func (l *LeagueQuery) TeamsWithDefaults() *TeamQuery
- func (q *LeagueQuery) ToString() string
- func (l *LeagueQuery) Transactions() *TransactionQuery
- func (l *LeagueQuery) TransactionsWithDefaults() *TransactionQuery
- type PlayerQuery
- func (p *PlayerQuery) Count(count int) *PlayerQuery
- func (q *PlayerQuery) Delete(client *http.Client) (*schema.FantasyContent, error)
- func (p *PlayerQuery) DraftAnalysis() *PlayerQuery
- func (q *PlayerQuery) Get(client *http.Client) (*schema.FantasyContent, error)
- func (p *PlayerQuery) Key(key string) *PlayerQuery
- func (p *PlayerQuery) Keys(keys []string) *PlayerQuery
- func (p *PlayerQuery) Opponent() *PlayerQuery
- func (p *PlayerQuery) Ownership() *PlayerQuery
- func (p *PlayerQuery) PercentOwned() *PlayerQuery
- func (p *PlayerQuery) Position(pos string) *PlayerQuery
- func (q *PlayerQuery) Post(client *http.Client) (*schema.FantasyContent, error)
- func (q *PlayerQuery) Put(client *http.Client) (*schema.FantasyContent, error)
- func (q *PlayerQuery) Reset()
- func (p *PlayerQuery) Search(name string) *PlayerQuery
- func (p *PlayerQuery) Sort(sort PlayerSortCriteria) *PlayerQuery
- func (p *PlayerQuery) SortByStat(statID int) *PlayerQuery
- func (p *PlayerQuery) SortDate(date string) *PlayerQuery
- func (p *PlayerQuery) SortSeason(season int) *PlayerQuery
- func (p *PlayerQuery) SortType(sortType PlayerSortType) *PlayerQuery
- func (p *PlayerQuery) SortWeek(week int) *PlayerQuery
- func (p *PlayerQuery) Start(start int) *PlayerQuery
- func (p *PlayerQuery) Stats() *StatsQuery
- func (p *PlayerQuery) StatsWithDefaults() *PlayerQuery
- func (p *PlayerQuery) Status(status PlayerStatus) *PlayerQuery
- func (q *PlayerQuery) ToString() string
- type PlayerSortCriteria
- type PlayerSortType
- type PlayerStatus
- type StatsQuery
- func (s *StatsQuery) CurrentSeason() *StatsQuery
- func (s *StatsQuery) CurrentSeasonAverage() *StatsQuery
- func (s *StatsQuery) Day(date string) *StatsQuery
- func (q *StatsQuery) Delete(client *http.Client) (*schema.FantasyContent, error)
- func (q *StatsQuery) Get(client *http.Client) (*schema.FantasyContent, error)
- func (s *StatsQuery) LastMonth() *StatsQuery
- func (s *StatsQuery) LastMonthAverage() *StatsQuery
- func (s *StatsQuery) LastWeek() *StatsQuery
- func (s *StatsQuery) LastWeekAverage() *StatsQuery
- func (q *StatsQuery) Post(client *http.Client) (*schema.FantasyContent, error)
- func (q *StatsQuery) Put(client *http.Client) (*schema.FantasyContent, error)
- func (q *StatsQuery) Reset()
- func (s *StatsQuery) Season(season int) *StatsQuery
- func (s *StatsQuery) SeasonAverage(season int) *StatsQuery
- func (q *StatsQuery) ToString() string
- func (s *StatsQuery) Today() *StatsQuery
- func (s *StatsQuery) Week(week int) *StatsQuery
- type TeamQuery
- func (t *TeamQuery) AllMatchups() *TeamQuery
- func (q *TeamQuery) Delete(client *http.Client) (*schema.FantasyContent, error)
- func (t *TeamQuery) DraftResults() *TeamQuery
- func (q *TeamQuery) Get(client *http.Client) (*schema.FantasyContent, error)
- func (t *TeamQuery) Key(key string) *TeamQuery
- func (t *TeamQuery) Keys(keys []string) *TeamQuery
- func (t *TeamQuery) Matchups(weeks []int) *TeamQuery
- func (t *TeamQuery) PositionalRanks() *TeamQuery
- func (q *TeamQuery) Post(client *http.Client) (*schema.FantasyContent, error)
- func (q *TeamQuery) Put(client *http.Client) (*schema.FantasyContent, error)
- func (t *TeamQuery) RecommendedTradePartners() *TeamQuery
- func (q *TeamQuery) Reset()
- func (t *TeamQuery) Roster() *TeamQuery
- func (t *TeamQuery) RosterDay(date string) *TeamRosterQuery
- func (t *TeamQuery) RosterWeek(week int) *TeamRosterQuery
- func (t *TeamQuery) Standings() *TeamQuery
- func (t *TeamQuery) Stats() *StatsQuery
- func (t *TeamQuery) StatsWithDefaults() *TeamQuery
- func (q *TeamQuery) ToString() string
- type TeamRosterQuery
- func (q *TeamRosterQuery) Delete(client *http.Client) (*schema.FantasyContent, error)
- func (q *TeamRosterQuery) Get(client *http.Client) (*schema.FantasyContent, error)
- func (q *TeamRosterQuery) Post(client *http.Client) (*schema.FantasyContent, error)
- func (q *TeamRosterQuery) Put(client *http.Client) (*schema.FantasyContent, error)
- func (q *TeamRosterQuery) Reset()
- func (q *TeamRosterQuery) ToString() string
- type TransactionQuery
- func (t *TransactionQuery) AcceptTrade(transactionKey, note string) *TransactionQuery
- func (t *TransactionQuery) Add(teamKey, playerKey string) *TransactionQuery
- func (t *TransactionQuery) AddDrop(teamKey, addPlayerKey, dropPlayerKey string) *TransactionQuery
- func (t *TransactionQuery) AllowTrade(transactionKey string) *TransactionQuery
- func (t *TransactionQuery) CancelTrade(transactionKey string) *TransactionQuery
- func (t *TransactionQuery) CancelWaiverClaim(transactionKey string) *TransactionQuery
- func (t *TransactionQuery) Count(count int) *TransactionQuery
- func (q *TransactionQuery) Delete(client *http.Client) (*schema.FantasyContent, error)
- func (t *TransactionQuery) DisallowTrade(transactionKey string) *TransactionQuery
- func (t *TransactionQuery) Drop(teamKey, playerKey string) *TransactionQuery
- func (q *TransactionQuery) Get(client *http.Client) (*schema.FantasyContent, error)
- func (t *TransactionQuery) Key(key string) *TransactionQuery
- func (t *TransactionQuery) Keys(keys []string) *TransactionQuery
- func (q *TransactionQuery) Post(client *http.Client) (*schema.FantasyContent, error)
- func (q *TransactionQuery) Put(client *http.Client) (*schema.FantasyContent, error)
- func (t *TransactionQuery) RejectTrade(transactionKey, note string) *TransactionQuery
- func (q *TransactionQuery) Reset()
- func (t *TransactionQuery) TeamKey(key string) *TransactionQuery
- func (q *TransactionQuery) ToString() string
- func (t *TransactionQuery) Types(types []string) *TransactionQuery
- func (t *TransactionQuery) UpdateWaiverClaim(transactionKey string, priority, faab int) *TransactionQuery
- func (t *TransactionQuery) UpdateWaiverClaimFAAB(transactionKey string, faab int) *TransactionQuery
- func (t *TransactionQuery) UpdateWaiverClaimPriority(transactionKey string, priority int) *TransactionQuery
- func (t *TransactionQuery) VoteAgainstTrade(transactionKey, voterTeamKey string) *TransactionQuery
- type UserQuery
- func (q *UserQuery) Delete(client *http.Client) (*schema.FantasyContent, error)
- func (u *UserQuery) Games() *GameQuery
- func (q *UserQuery) Get(client *http.Client) (*schema.FantasyContent, error)
- func (u *UserQuery) Leagues() *LeagueQuery
- func (q *UserQuery) Post(client *http.Client) (*schema.FantasyContent, error)
- func (q *UserQuery) Put(client *http.Client) (*schema.FantasyContent, error)
- func (q *UserQuery) Reset()
- func (u *UserQuery) Teams() *TeamQuery
- func (q *UserQuery) ToString() string
Constants ¶
const ( PlayerStatusUnknown PlayerStatus = "" PlayerStatusAvailable = "A" PlayerStatusFreeAgent = "FA" PlayerStatusWaiver = "W" PlayerStatusTaken = "T" PlayerStatusKeeper = "K" )
Enum for a player's ownership status.
const ( PlayerSortCriteriaUnknown PlayerSortCriteria = "" PlayerSortCriteriaName = "NAME" PlayerSortCriteriaOverallRank = "OR" PlayerSortCriteriaActualRank = "AR" PlayerSortCriteriaFantasyPoints = "PTS" )
Enum for player sort criteria.
const ( PlayerSortTypeUnknown PlayerSortType = "" PlayerSortTypeSeason = "season" PlayerSortTypeDate = "date" PlayerSortTypeWeek = "week" PlayerSortTypeLastMonth = "lastmonth" PlayerSortTypeLastWeek = "lastweek" )
Enum for player sort type.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GameQuery ¶
type GameQuery struct {
// contains filtered or unexported fields
}
GameQuery can be used to query the /games or /game Yahoo Fantasy endpoints.
func (*GameQuery) Codes ¶
Codes adds the "game_codes" parameter with the given codes to the query. Any valid game code can be provided (incl. nba, nhl, nfl, mlb).
func (*GameQuery) Delete ¶
func (q *GameQuery) Delete(client *http.Client) (*schema.FantasyContent, error)
Delete sends a "DELETE" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.
func (*GameQuery) GameWeeks ¶
GameWeeks adds the "game_weeks" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. game/game_weeks).
func (*GameQuery) Get ¶
func (q *GameQuery) Get(client *http.Client) (*schema.FantasyContent, error)
Get sends a "GET" request to the Yahoo Fantasy endpoint that the query would generate using the provided client.
func (*GameQuery) IsAvailable ¶
IsAvailable adds the "is_available" parameter to the query.
func (*GameQuery) Key ¶
Key sets the "game_keys" parameter to the the given key. When querying the /game endpoint the key will be appended to the query path (i.e. /game/<key>).
func (*GameQuery) Leagues ¶
func (g *GameQuery) Leagues() *LeagueQuery
Leagues returns a LeagueQuery for the /leagues subresource.
func (*GameQuery) Players ¶
func (g *GameQuery) Players() *PlayerQuery
Players returns a PlayerQuery for the /teams subresource.
func (*GameQuery) PositionTypes ¶
PositionTypes adds the "positions_types" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. game/position_types).
func (*GameQuery) Post ¶
func (q *GameQuery) Post(client *http.Client) (*schema.FantasyContent, error)
Post sends a "POST" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.
func (*GameQuery) Put ¶
func (q *GameQuery) Put(client *http.Client) (*schema.FantasyContent, error)
Put sends a "PUT" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.
func (*GameQuery) RosterPositions ¶
RosterPositions adds the "roster_positions" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. game/roster_positions).
func (*GameQuery) Seasons ¶
Seasons adds the "seasons" parameter with the given seasons to the query.
func (*GameQuery) StatCategories ¶
StatCategories adds the "stat_categories" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. game/stat_categories).
type LeagueQuery ¶
type LeagueQuery struct {
// contains filtered or unexported fields
}
LeagueQuery can be used to query the /leagues or /league Yahoo Fantasy endpoints.
func (*LeagueQuery) CurrentScoreboard ¶
func (l *LeagueQuery) CurrentScoreboard() *LeagueQuery
CurrentScoreboard adds the "scoreboard" subresource to the request to query the scoreboard for the current week. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. league/scoreboard).
func (*LeagueQuery) Delete ¶
func (q *LeagueQuery) Delete(client *http.Client) (*schema.FantasyContent, error)
Delete sends a "DELETE" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.
func (*LeagueQuery) DraftResults ¶
func (l *LeagueQuery) DraftResults() *LeagueQuery
DraftResults adds the "draftresults" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. league/draftresults).
func (*LeagueQuery) Get ¶
func (q *LeagueQuery) Get(client *http.Client) (*schema.FantasyContent, error)
Get sends a "GET" request to the Yahoo Fantasy endpoint that the query would generate using the provided client.
func (*LeagueQuery) Key ¶
func (l *LeagueQuery) Key(key string) *LeagueQuery
Key sets the league_keys parameter to the the given key. When querying the /league endpoint the key will be appended to the query path (i.e. /league/<key>).
func (*LeagueQuery) Keys ¶
func (l *LeagueQuery) Keys(keys []string) *LeagueQuery
Keys adds the league_keys parameter with the given keys to the query.
func (*LeagueQuery) Players ¶
func (l *LeagueQuery) Players() *PlayerQuery
Players returns a PlayerQuery for the /players subresource.
func (*LeagueQuery) PlayersWithDefaults ¶
func (l *LeagueQuery) PlayersWithDefaults() *PlayerQuery
PlayersWithDefaults adds the "players" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. league/players).
func (*LeagueQuery) Post ¶
func (q *LeagueQuery) Post(client *http.Client) (*schema.FantasyContent, error)
Post sends a "POST" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.
func (*LeagueQuery) Put ¶
func (q *LeagueQuery) Put(client *http.Client) (*schema.FantasyContent, error)
Put sends a "PUT" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.
func (*LeagueQuery) Scoreboard ¶
func (l *LeagueQuery) Scoreboard(week int) *LeagueQuery
Scoreboard adds the "scoreboard" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. league/scoreboard). week is expected by Yahoo to be a positive integer.
func (*LeagueQuery) Settings ¶
func (l *LeagueQuery) Settings() *LeagueQuery
Settings adds the "settings" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. league/settings).
func (*LeagueQuery) Standings ¶
func (l *LeagueQuery) Standings() *LeagueQuery
Standings adds the "standings" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. league/standings).
func (*LeagueQuery) Teams ¶
func (l *LeagueQuery) Teams() *TeamQuery
Teams returns a TeamQuery for the /teams subresource.
func (*LeagueQuery) TeamsWithDefaults ¶
func (l *LeagueQuery) TeamsWithDefaults() *TeamQuery
TeamsWithDefaults adds the "teams" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. league/teams).
func (*LeagueQuery) ToString ¶
func (q *LeagueQuery) ToString() string
ToString generates the endpoint string for the query
func (*LeagueQuery) Transactions ¶
func (l *LeagueQuery) Transactions() *TransactionQuery
Transactions returns a TransactionQuery for the /transactions subresource.
func (*LeagueQuery) TransactionsWithDefaults ¶
func (l *LeagueQuery) TransactionsWithDefaults() *TransactionQuery
TransactionsWithDefaults adds the "teams" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. league/transactions).
type PlayerQuery ¶
type PlayerQuery struct {
// contains filtered or unexported fields
}
PlayerQuery can be used to query the /players or /player Yahoo Fantasy endpoints.
func (*PlayerQuery) Count ¶
func (p *PlayerQuery) Count(count int) *PlayerQuery
Count adds the "count" parameter with the provided count to the query. count is expected by Yahoo to be a positive integer.
func (*PlayerQuery) Delete ¶
func (q *PlayerQuery) Delete(client *http.Client) (*schema.FantasyContent, error)
Delete sends a "DELETE" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.
func (*PlayerQuery) DraftAnalysis ¶
func (p *PlayerQuery) DraftAnalysis() *PlayerQuery
DraftAnalysis adds the "draft_analysis" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. player/draft_analysis).
func (*PlayerQuery) Get ¶
func (q *PlayerQuery) Get(client *http.Client) (*schema.FantasyContent, error)
Get sends a "GET" request to the Yahoo Fantasy endpoint that the query would generate using the provided client.
func (*PlayerQuery) Key ¶
func (p *PlayerQuery) Key(key string) *PlayerQuery
Key sets the "player_keys" parameter to the the given key. When querying the /game endpoint the key will be appended to the query path (i.e. /player/<key>).
func (*PlayerQuery) Keys ¶
func (p *PlayerQuery) Keys(keys []string) *PlayerQuery
Keys adds the "player_keys" parameter with the given keys to the query.
func (*PlayerQuery) Opponent ¶ added in v0.1.5
func (p *PlayerQuery) Opponent() *PlayerQuery
Opponent adds the "opponent" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. player/opponent).
func (*PlayerQuery) Ownership ¶
func (p *PlayerQuery) Ownership() *PlayerQuery
Ownership adds the "ownership" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. player/ownership).
func (*PlayerQuery) PercentOwned ¶
func (p *PlayerQuery) PercentOwned() *PlayerQuery
PercentOwned adds the "percent_owned" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. player/percent_owned).
func (*PlayerQuery) Position ¶
func (p *PlayerQuery) Position(pos string) *PlayerQuery
Position adds the "position" parameter with the provided position to the query. Valid player positions can be provided as input (e.x. "QB", "PG")
func (*PlayerQuery) Post ¶
func (q *PlayerQuery) Post(client *http.Client) (*schema.FantasyContent, error)
Post sends a "POST" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.
func (*PlayerQuery) Put ¶
func (q *PlayerQuery) Put(client *http.Client) (*schema.FantasyContent, error)
Put sends a "PUT" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.
func (*PlayerQuery) Search ¶
func (p *PlayerQuery) Search(name string) *PlayerQuery
Search adds the "search" parameter with the provided name to the query.
func (*PlayerQuery) Sort ¶
func (p *PlayerQuery) Sort(sort PlayerSortCriteria) *PlayerQuery
Sort adds the "sort" parameter with the provided sort criteria to the query.
func (*PlayerQuery) SortByStat ¶ added in v0.1.3
func (p *PlayerQuery) SortByStat(statID int) *PlayerQuery
SortByStat adds the "sort" parameter with the provided stat id to the query.
func (*PlayerQuery) SortDate ¶
func (p *PlayerQuery) SortDate(date string) *PlayerQuery
SortDate adds the "sort_date" parameter with the provided date to the query. date should be formatted as YYYY-MM-DD.
func (*PlayerQuery) SortSeason ¶
func (p *PlayerQuery) SortSeason(season int) *PlayerQuery
SortSeason adds the "sort_season" parameter with the provided season to the query.
func (*PlayerQuery) SortType ¶
func (p *PlayerQuery) SortType(sortType PlayerSortType) *PlayerQuery
SortType adds the "sort_type" parameter with the provided type to the query.
func (*PlayerQuery) SortWeek ¶
func (p *PlayerQuery) SortWeek(week int) *PlayerQuery
SortWeek adds the "sort_week" parameter with the provided week to the query. Yahoo only supports this parameter for football. week is expected by Yahoo to be a positive integer.
func (*PlayerQuery) Start ¶
func (p *PlayerQuery) Start(start int) *PlayerQuery
Start adds the "start" parameter with the provided start to the query. start is expected by Yahoo to be a positive integer.
func (*PlayerQuery) Stats ¶
func (p *PlayerQuery) Stats() *StatsQuery
Stats returns a StatsQuery for the /stats subresource.
func (*PlayerQuery) StatsWithDefaults ¶
func (p *PlayerQuery) StatsWithDefaults() *PlayerQuery
StatsWithDefaults adds the "stats" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. player/stats).
func (*PlayerQuery) Status ¶
func (p *PlayerQuery) Status(status PlayerStatus) *PlayerQuery
Status adds the "status" parameter with the provided status to the query.
type PlayerSortCriteria ¶ added in v0.1.3
type PlayerSortCriteria string
PlayerSortCriteria represents the sort criteria for players.
type PlayerSortType ¶ added in v0.1.3
type PlayerSortType string
PlayerSortType represent the sort type for players.
type PlayerStatus ¶ added in v0.1.3
type PlayerStatus string
PlayerStatus represents a player's ownership status.
type StatsQuery ¶
type StatsQuery struct {
// contains filtered or unexported fields
}
StatsQuery can be used to query the /stats endpoint.
func Stats ¶
func Stats() *StatsQuery
Stats returns a StatsQuery for the /stats subresource endpoint.
func (*StatsQuery) CurrentSeason ¶
func (s *StatsQuery) CurrentSeason() *StatsQuery
CurrentSeason adds the "type=season" parameter to the query.
func (*StatsQuery) CurrentSeasonAverage ¶
func (s *StatsQuery) CurrentSeasonAverage() *StatsQuery
CurrentSeasonAverage adds the "type=average_season" parameter to the query.
func (*StatsQuery) Day ¶
func (s *StatsQuery) Day(date string) *StatsQuery
Day adds the "type=date" parameter and "date" parameter with the provided date to the query. date is expected to be formatted as YYYY-MM-DD.
func (*StatsQuery) Delete ¶
func (q *StatsQuery) Delete(client *http.Client) (*schema.FantasyContent, error)
Delete sends a "DELETE" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.
func (*StatsQuery) Get ¶
func (q *StatsQuery) Get(client *http.Client) (*schema.FantasyContent, error)
Get sends a "GET" request to the Yahoo Fantasy endpoint that the query would generate using the provided client.
func (*StatsQuery) LastMonth ¶
func (s *StatsQuery) LastMonth() *StatsQuery
LastMonth adds the "type=lastmonth" parameter to the query.
func (*StatsQuery) LastMonthAverage ¶
func (s *StatsQuery) LastMonthAverage() *StatsQuery
LastMonthAverage adds the "type=average_lastmonth" parameter to the query.
func (*StatsQuery) LastWeek ¶
func (s *StatsQuery) LastWeek() *StatsQuery
LastWeek adds the "type=lastweek" parameter to the query.
func (*StatsQuery) LastWeekAverage ¶
func (s *StatsQuery) LastWeekAverage() *StatsQuery
LastWeekAverage adds the "type=average_lastweek" parameter to the query.
func (*StatsQuery) Post ¶
func (q *StatsQuery) Post(client *http.Client) (*schema.FantasyContent, error)
Post sends a "POST" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.
func (*StatsQuery) Put ¶
func (q *StatsQuery) Put(client *http.Client) (*schema.FantasyContent, error)
Put sends a "PUT" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.
func (*StatsQuery) Season ¶
func (s *StatsQuery) Season(season int) *StatsQuery
Season adds the "type=season" parameter and "season" parameter with the provided season to the query.
func (*StatsQuery) SeasonAverage ¶
func (s *StatsQuery) SeasonAverage(season int) *StatsQuery
SeasonAverage adds the "type=average_season" parameter and "season" parameter with the provided season to the query.
func (*StatsQuery) ToString ¶
func (q *StatsQuery) ToString() string
ToString generates the endpoint string for the query
func (*StatsQuery) Today ¶
func (s *StatsQuery) Today() *StatsQuery
Today adds the "type=date" parameter to the query.
func (*StatsQuery) Week ¶ added in v0.1.3
func (s *StatsQuery) Week(week int) *StatsQuery
Week adds the "type=week" parameter to the query. Only supported by Yahoo for football.
type TeamQuery ¶
type TeamQuery struct {
// contains filtered or unexported fields
}
TeamQuery can be used to query the /teams or /team Yahoo Fantasy resource.
func (*TeamQuery) AllMatchups ¶
AllMatchups adds the "matchups" subresource to the request to request for all matchups. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. team/matchups).
func (*TeamQuery) Delete ¶
func (q *TeamQuery) Delete(client *http.Client) (*schema.FantasyContent, error)
Delete sends a "DELETE" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.
func (*TeamQuery) DraftResults ¶
DraftResults adds the "draftresults" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. team/draftresults).
func (*TeamQuery) Get ¶
func (q *TeamQuery) Get(client *http.Client) (*schema.FantasyContent, error)
Get sends a "GET" request to the Yahoo Fantasy endpoint that the query would generate using the provided client.
func (*TeamQuery) Key ¶
Key sets the "team_keys" parameter to the the given key. When querying the /team endpoint the key will be appended to the query path (i.e. /team/<key>).
func (*TeamQuery) Matchups ¶
Matchups adds the "matchups" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. team/matchups). weeks is expected by Yahoo to contain positive integers.
func (*TeamQuery) PositionalRanks ¶ added in v0.1.5
PositionalRanks adds the "positional_ranks" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. team/positional_ranks).
func (*TeamQuery) Post ¶
func (q *TeamQuery) Post(client *http.Client) (*schema.FantasyContent, error)
Post sends a "POST" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.
func (*TeamQuery) Put ¶
func (q *TeamQuery) Put(client *http.Client) (*schema.FantasyContent, error)
Put sends a "PUT" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.
func (*TeamQuery) RecommendedTradePartners ¶ added in v0.1.5
RecommendedTradePartners adds the "recommended_trade_partners" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. team/recommended_trade_partners).
func (*TeamQuery) Roster ¶
Roster adds the "roster" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. team/roster).
func (*TeamQuery) RosterDay ¶
func (t *TeamQuery) RosterDay(date string) *TeamRosterQuery
RosterDay returns a TeamRosterQuery for the /roster subresource with the "date" parameter set to the provided date. date is expected to be formatted as YYYY-MM-DD.
func (*TeamQuery) RosterWeek ¶
func (t *TeamQuery) RosterWeek(week int) *TeamRosterQuery
RosterWeek returns a TeamRosterQuery for the /roster subresource with the "week" parameter set to the provided week. week is expected by Yahoo to be a positive integer.
func (*TeamQuery) Standings ¶
Standings adds the "standings" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. team/standings).
func (*TeamQuery) Stats ¶
func (t *TeamQuery) Stats() *StatsQuery
Stats returns a StatsQuery for the /stats subresource.
func (*TeamQuery) StatsWithDefaults ¶
StatsWithDefaults adds the "stats" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. team/stats).
type TeamRosterQuery ¶
type TeamRosterQuery struct {
// contains filtered or unexported fields
}
TeamRosterQuery can be used to query the /roster subresource of Game resource.
func (*TeamRosterQuery) Delete ¶
func (q *TeamRosterQuery) Delete(client *http.Client) (*schema.FantasyContent, error)
Delete sends a "DELETE" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.
func (*TeamRosterQuery) Get ¶
func (q *TeamRosterQuery) Get(client *http.Client) (*schema.FantasyContent, error)
Get sends a "GET" request to the Yahoo Fantasy endpoint that the query would generate using the provided client.
func (*TeamRosterQuery) Post ¶
func (q *TeamRosterQuery) Post(client *http.Client) (*schema.FantasyContent, error)
Post sends a "POST" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.
type TransactionQuery ¶
type TransactionQuery struct {
// contains filtered or unexported fields
}
TransactionQuery can be used to query the /transactions or /transaction Yahoo Fantasy endpoints.
func Transaction ¶
func Transaction() *TransactionQuery
Transaction returns a TransactionQuery for the /transaction endpoint.
func Transactions ¶
func Transactions() *TransactionQuery
Transactions returns a TransactionQuery for the /transactions endpoint.
func (*TransactionQuery) AcceptTrade ¶
func (t *TransactionQuery) AcceptTrade(transactionKey, note string) *TransactionQuery
AcceptTrade set the payload of the query to perform an accept trade action. Use the Put method to send this payload. This payload works with the /transaction endpoint.
func (*TransactionQuery) Add ¶
func (t *TransactionQuery) Add(teamKey, playerKey string) *TransactionQuery
Add sets the payload of the query to an "add" transaction. Use the Post method to send the payload. This payload works with the /transactions endpoint.
func (*TransactionQuery) AddDrop ¶
func (t *TransactionQuery) AddDrop(teamKey, addPlayerKey, dropPlayerKey string) *TransactionQuery
AddDrop sets the payload of the query to an "add/drop" transaction. Use the Post method to send the payload. This payload works with the /transactions endpoint.
func (*TransactionQuery) AllowTrade ¶
func (t *TransactionQuery) AllowTrade(transactionKey string) *TransactionQuery
AllowTrade set the payload of the query to perform an allow trade action. Use the Put method to send this payload. This payload works with the /transaction endpoint.
func (*TransactionQuery) CancelTrade ¶
func (t *TransactionQuery) CancelTrade(transactionKey string) *TransactionQuery
CancelTrade set the payload of the query to perform a cancel trade action. Use the Delete method to send this payload. This payload works with the /transaction endpoint.
func (*TransactionQuery) CancelWaiverClaim ¶
func (t *TransactionQuery) CancelWaiverClaim(transactionKey string) *TransactionQuery
CancelWaiverClaim set the payload of the query to perform a cancel waiver claim action. Use the Delete method to send this payload. This payload works with the /transaction endpoint.
func (*TransactionQuery) Count ¶
func (t *TransactionQuery) Count(count int) *TransactionQuery
Count adds the "count" parameter with the given count to the query. count is expected by Yahoo to be a positive integer.
func (*TransactionQuery) Delete ¶
func (q *TransactionQuery) Delete(client *http.Client) (*schema.FantasyContent, error)
Delete sends a "DELETE" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.
func (*TransactionQuery) DisallowTrade ¶
func (t *TransactionQuery) DisallowTrade(transactionKey string) *TransactionQuery
DisallowTrade set the payload of the query to perform a disallow trade action. Use the Put method to send this payload. This payload works with the /transaction endpoint.
func (*TransactionQuery) Drop ¶
func (t *TransactionQuery) Drop(teamKey, playerKey string) *TransactionQuery
Drop sets the payload of the query to a "drop" transaction. Use the Post method to send the payload. This payload works with the /transactions endpoint.
func (*TransactionQuery) Get ¶
func (q *TransactionQuery) Get(client *http.Client) (*schema.FantasyContent, error)
Get sends a "GET" request to the Yahoo Fantasy endpoint that the query would generate using the provided client.
func (*TransactionQuery) Key ¶
func (t *TransactionQuery) Key(key string) *TransactionQuery
Key sets the "transaction_keys" parameter to the the given key. When querying the /transaction endpoint the key will be appended to the query path (i.e. /transaction/<key>).
func (*TransactionQuery) Keys ¶
func (t *TransactionQuery) Keys(keys []string) *TransactionQuery
Keys adds the "transaction_keys" parameter with the given keys to the query.
func (*TransactionQuery) Post ¶
func (q *TransactionQuery) Post(client *http.Client) (*schema.FantasyContent, error)
Post sends a "POST" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.
func (*TransactionQuery) Put ¶
func (q *TransactionQuery) Put(client *http.Client) (*schema.FantasyContent, error)
Put sends a "PUT" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.
func (*TransactionQuery) RejectTrade ¶
func (t *TransactionQuery) RejectTrade(transactionKey, note string) *TransactionQuery
RejectTrade set the payload of the query to perform a reject trade action. Use the Put method to send this payload. This payload works with the /transaction endpoint.
func (*TransactionQuery) TeamKey ¶
func (t *TransactionQuery) TeamKey(key string) *TransactionQuery
TeamKey adds the "team_key" parameter with the provided key to the query.
func (*TransactionQuery) ToString ¶
func (q *TransactionQuery) ToString() string
ToString generates the endpoint string for the query
func (*TransactionQuery) Types ¶
func (t *TransactionQuery) Types(types []string) *TransactionQuery
Types sets the "transaction_types" parameter with the given types to the query. Valid types are add,drop,commish,trade.
func (*TransactionQuery) UpdateWaiverClaim ¶
func (t *TransactionQuery) UpdateWaiverClaim(transactionKey string, priority, faab int) *TransactionQuery
UpdateWaiverClaim set the payload of the query to perform a waiver claim update on priority and FAAB. Use the Put method to send this payload. This payload works with the /transaction endpoint.
func (*TransactionQuery) UpdateWaiverClaimFAAB ¶
func (t *TransactionQuery) UpdateWaiverClaimFAAB(transactionKey string, faab int) *TransactionQuery
UpdateWaiverClaimFAAB set the payload of the query to perform a waiver claim update on FAAB. Use the Put method to send this payload. This payload works with the /transaction endpoint.
func (*TransactionQuery) UpdateWaiverClaimPriority ¶
func (t *TransactionQuery) UpdateWaiverClaimPriority(transactionKey string, priority int) *TransactionQuery
UpdateWaiverClaimPriority set the payload of the query to perform a waiver claim update on priority. Use the Put method to send this payload. This payload works with the /transaction endpoint.
func (*TransactionQuery) VoteAgainstTrade ¶
func (t *TransactionQuery) VoteAgainstTrade(transactionKey, voterTeamKey string) *TransactionQuery
VoteAgainstTrade set the payload of the query to perform a vote against trade action. Use the Put method to send this payload. This payload works with the /transaction endpoint.
type UserQuery ¶
type UserQuery struct {
// contains filtered or unexported fields
}
UserQuery can be used to query the /users Yahoo Fantasy endpoint.
func (*UserQuery) Delete ¶
func (q *UserQuery) Delete(client *http.Client) (*schema.FantasyContent, error)
Delete sends a "DELETE" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.
func (*UserQuery) Get ¶
func (q *UserQuery) Get(client *http.Client) (*schema.FantasyContent, error)
Get sends a "GET" request to the Yahoo Fantasy endpoint that the query would generate using the provided client.
func (*UserQuery) Leagues ¶
func (u *UserQuery) Leagues() *LeagueQuery
Leagues returns a GameQuery for the /leagues subresource.
func (*UserQuery) Post ¶
func (q *UserQuery) Post(client *http.Client) (*schema.FantasyContent, error)
Post sends a "POST" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.
func (*UserQuery) Put ¶
func (q *UserQuery) Put(client *http.Client) (*schema.FantasyContent, error)
Put sends a "PUT" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.