go-footballdata/req_soccerseasons.go

36 lines
722 B
Go
Raw Normal View History

2016-06-12 22:39:00 +00:00
package footballdata
import "fmt"
// DEPRECATED.
//
2016-06-12 22:39:00 +00:00
type SoccerSeasonsRequest struct{ request }
// DEPRECATED.
//
// Season modifies the request to specify a season.
2016-06-12 22:39:00 +00:00
func (r SoccerSeasonsRequest) Season(num uint32) SoccerSeasonsRequest {
r.urlValues.Set("season", fmt.Sprintf("%d", num))
2016-06-12 22:39:00 +00:00
return r
}
// DEPRECATED.
//
// Do executes the request.
2016-06-12 22:39:00 +00:00
func (r SoccerSeasonsRequest) Do() (s SoccerSeasonList, err error) {
d, _, err := r.doJson("GET")
if err != nil {
return
}
err = d.Decode(&s)
return
}
// DEPRECATED.
//
// SoccerSeasons prepares a request to fetch the complete list of soccer seasons.
func (c *Client) SoccerSeasons() SoccerSeasonsRequest {
2016-06-12 22:39:00 +00:00
return SoccerSeasonsRequest{c.req("soccerseasons")}
}