diff --git a/client.go b/client.go index ad9edae..c801491 100644 --- a/client.go +++ b/client.go @@ -41,15 +41,15 @@ type client struct { AuthToken string } -// NewClient Creates a new Client instance that wraps around the given HTTP client. +// NewClient creates a new Client instance that wraps around the given HTTP client. // // Call SetToken to add your token. func NewClient(h *http.Client) Client { return &client{httpClient: h} } -// SetToken Set the authentication token -// Calling this method is *optional* +// SetToken sets the authentication token. +// Calling this method is *optional*. func (c *client) SetToken(authToken string) { c.AuthToken = authToken } diff --git a/req_fixture.go b/req_fixture.go index 8d456e6..3c43651 100644 --- a/req_fixture.go +++ b/req_fixture.go @@ -4,13 +4,13 @@ import "fmt" type FixtureRequest struct{ request } -// Head2Head Modifies the request to specify the number of former games to be analyzed (normally 10). +// Head2Head modifies the request to specify the number of former games to be analyzed (normally 10). func (r FixtureRequest) Head2Head(num uint16) FixtureRequest { r.urlValues.Set("head2head", fmt.Sprintf("%d", num)) return r } -// Do Executes the request. +// Do executes the request. func (r FixtureRequest) Do() (s Fixture, err error) { d, _, err := r.doJson("GET") if err != nil { @@ -21,7 +21,7 @@ func (r FixtureRequest) Do() (s Fixture, err error) { return } -// Fixture Prepares a request to fetch the fixtures of a soccer season. +// Fixture prepares a request to fetch the fixtures of a soccer season. func (c *client) Fixture(id uint64) FixtureRequest { return FixtureRequest{c.req("fixture/%d", id)} } diff --git a/req_fixtures.go b/req_fixtures.go index dac81dc..e0f0c6e 100644 --- a/req_fixtures.go +++ b/req_fixtures.go @@ -7,19 +7,19 @@ import ( type FixturesRequest struct{ request } -// TimeFrame Modifies the request to specify a specific time frame. +// TimeFrame modifies the request to specify a specific time frame. func (r FixturesRequest) TimeFrame(timeframe time.Duration) FixturesRequest { r.urlValues.Set("timeFrame", durationToTimeFrame(timeframe)) return r } -// League Modifies the request to specify a list of leagues by their code. +// League modifies the request to specify a list of leagues by their code. func (r FixturesRequest) League(leagueCodes ...string) FixturesRequest { r.urlValues.Set("league", strings.Join(leagueCodes, ",")) return r } -// Do Executes the request. +// Do executes the request. func (r FixturesRequest) Do() (s FixturesResponse, err error) { d, _, err := r.doJson("GET") if err != nil { @@ -30,7 +30,7 @@ func (r FixturesRequest) Do() (s FixturesResponse, err error) { return } -// Fixtures Prepares a request to fetch the fixtures of a soccer season. +// Fixtures prepares a request to fetch the fixtures of a soccer season. func (c *client) Fixtures() FixturesRequest { return FixturesRequest{c.req("fixtures")} } diff --git a/req_soccerseason.go b/req_soccerseason.go index 3fa03df..fccaad9 100644 --- a/req_soccerseason.go +++ b/req_soccerseason.go @@ -2,7 +2,7 @@ package footballdata type SoccerSeasonRequest struct{ request } -// Do Executes the request. +// Do executes the request. func (r SoccerSeasonRequest) Do() (s SoccerSeason, err error) { d, _, err := r.doJson("GET") if err != nil { @@ -13,7 +13,7 @@ func (r SoccerSeasonRequest) Do() (s SoccerSeason, err error) { return } -// SoccerSeason Prepares a request to fetch the complete list of soccer seasons. +// SoccerSeason prepares a request to fetch the complete list of soccer seasons. func (c *client) SoccerSeason(id uint64) SoccerSeasonRequest { return SoccerSeasonRequest{c.req("soccerseasons/%d", id)} } diff --git a/req_soccerseason_fixtures.go b/req_soccerseason_fixtures.go index 74010d7..c026a1d 100644 --- a/req_soccerseason_fixtures.go +++ b/req_soccerseason_fixtures.go @@ -7,19 +7,19 @@ import ( type SoccerSeasonFixturesRequest struct{ request } -// Matchday Modifies the request to specify a match day. +// Matchday modifies the request to specify a match day. func (r SoccerSeasonFixturesRequest) Matchday(matchday uint16) SoccerSeasonFixturesRequest { r.urlValues.Set("matchday", fmt.Sprintf("%d", matchday)) return r } -// TimeFrame Modifies the request to specify a specific time frame. +// TimeFrame modifies the request to specify a specific time frame. func (r SoccerSeasonFixturesRequest) TimeFrame(timeframe time.Duration) SoccerSeasonFixturesRequest { r.urlValues.Set("timeFrame", durationToTimeFrame(timeframe)) return r } -// Do Executes the request. +// Do executes the request. func (r SoccerSeasonFixturesRequest) Do() (s FixtureList, err error) { d, _, err := r.doJson("GET") if err != nil { @@ -30,7 +30,7 @@ func (r SoccerSeasonFixturesRequest) Do() (s FixtureList, err error) { return } -// FixturesOfSoccerSeason Prepares a request to fetch the fixtures of a soccer season. +// FixturesOfSoccerSeason prepares a request to fetch the fixtures of a soccer season. func (c *client) FixturesOfSoccerSeason(soccerSeasonId uint64) SoccerSeasonFixturesRequest { return SoccerSeasonFixturesRequest{c.req("soccerseasons/%d/fixtures", soccerSeasonId)} } diff --git a/req_soccerseason_leaguetable.go b/req_soccerseason_leaguetable.go index cda202c..737653b 100644 --- a/req_soccerseason_leaguetable.go +++ b/req_soccerseason_leaguetable.go @@ -4,13 +4,13 @@ import "fmt" type SoccerSeasonLeagueTableRequest struct{ request } -// Matchday Modifies the request to specify a match day. +// Matchday modifies the request to specify a match day. func (r SoccerSeasonLeagueTableRequest) Matchday(matchday uint16) SoccerSeasonLeagueTableRequest { r.urlValues.Set("matchday", fmt.Sprintf("%d", matchday)) return r } -// Do Executes the request. +// Do executes the request. func (r SoccerSeasonLeagueTableRequest) Do() (s SoccerSeason, err error) { d, _, err := r.doJson("GET") if err != nil { @@ -21,7 +21,7 @@ func (r SoccerSeasonLeagueTableRequest) Do() (s SoccerSeason, err error) { return } -// LeagueTableOfSoccerSeason Prepares a new request to fetch the league table of a given soccer season. +// LeagueTableOfSoccerSeason prepares a new request to fetch the league table of a given soccer season. func (c *client) LeagueTableOfSoccerSeason(soccerSeasonId uint64) SoccerSeasonLeagueTableRequest { return SoccerSeasonLeagueTableRequest{c.req("soccerseasons/%d/leagueTable", soccerSeasonId)} } diff --git a/req_soccerseason_teams.go b/req_soccerseason_teams.go index cea43dd..e60a479 100644 --- a/req_soccerseason_teams.go +++ b/req_soccerseason_teams.go @@ -2,7 +2,7 @@ package footballdata type SoccerSeasonTeamsRequest struct{ request } -// Do Executes the request. +// Do executes the request. func (r SoccerSeasonTeamsRequest) Do() (s TeamList, err error) { d, _, err := r.doJson("GET") if err != nil { @@ -13,7 +13,7 @@ func (r SoccerSeasonTeamsRequest) Do() (s TeamList, err error) { return } -// TeamsOfSoccerSeason Prepares a new request to fetch the league table of a given soccer season. +// TeamsOfSoccerSeason prepares a new request to fetch the league table of a given soccer season. func (c *client) TeamsOfSoccerSeason(soccerSeasonId uint64) SoccerSeasonTeamsRequest { return SoccerSeasonTeamsRequest{c.req("soccerseasons/%d/leagueTable", soccerSeasonId)} } diff --git a/req_soccerseasons.go b/req_soccerseasons.go index 529cb23..6b1408e 100644 --- a/req_soccerseasons.go +++ b/req_soccerseasons.go @@ -4,13 +4,13 @@ import "fmt" type SoccerSeasonsRequest struct{ request } -// Season Modifies the request to specify a season. +// Season modifies the request to specify a season. func (r SoccerSeasonsRequest) Season(num uint32) SoccerSeasonsRequest { r.urlValues.Set("season", fmt.Sprintf("%d", num)) return r } -// Do Executes the request. +// Do executes the request. func (r SoccerSeasonsRequest) Do() (s SoccerSeasonList, err error) { d, _, err := r.doJson("GET") if err != nil { @@ -21,7 +21,7 @@ func (r SoccerSeasonsRequest) Do() (s SoccerSeasonList, err error) { return } -// SoccerSeasons Prepares a request to fetch the complete list of soccer seasons. +// SoccerSeasons prepares a request to fetch the complete list of soccer seasons. func (c *client) SoccerSeasons() SoccerSeasonsRequest { return SoccerSeasonsRequest{c.req("soccerseasons")} } diff --git a/req_team.go b/req_team.go index 3940862..c961502 100644 --- a/req_team.go +++ b/req_team.go @@ -5,7 +5,7 @@ type TeamRequest struct { id uint64 } -// Do Executes the request. +// Do executes the request. func (r TeamRequest) Do() (s Team, err error) { d, _, err := r.doJson("GET") if err != nil { @@ -20,7 +20,7 @@ func (r TeamRequest) Do() (s Team, err error) { return } -// Team Prepares a request to fetch a team's information. +// Team prepares a request to fetch a team's information. func (c *client) Team(id uint64) TeamRequest { return TeamRequest{c.req("teams/%d", id), id} } diff --git a/req_team_fixtures.go b/req_team_fixtures.go index 2f552a7..d63e03e 100644 --- a/req_team_fixtures.go +++ b/req_team_fixtures.go @@ -7,25 +7,25 @@ import ( type TeamFixturesRequest struct{ request } -// TimeFrame Modifies the request to specify a specific time frame. +// TimeFrame modifies the request to specify a specific time frame. func (r TeamFixturesRequest) TimeFrame(timeframe time.Duration) TeamFixturesRequest { r.urlValues.Set("timeFrame", durationToTimeFrame(timeframe)) return r } -// Season Modifies the request to specify a list of leagues by their code. +// Season modifies the request to specify a list of leagues by their code. func (r TeamFixturesRequest) Season(season uint64) TeamFixturesRequest { r.urlValues.Set("season", fmt.Sprintf("%d", season)) return r } -// Venue Modifies the request to specify a venue. +// Venue modifies the request to specify a venue. func (r TeamFixturesRequest) Venue(venue Venue) TeamFixturesRequest { r.urlValues.Set("venue", string(venue)) return r } -// Do Executes the request. +// Do executes the request. func (r TeamFixturesRequest) Do() (s FixturesResponse, err error) { d, _, err := r.doJson("GET") if err != nil { @@ -36,7 +36,7 @@ func (r TeamFixturesRequest) Do() (s FixturesResponse, err error) { return } -// FixturesOfTeam Prepares a request to fetch the fixtures of a soccer season. +// FixturesOfTeam prepares a request to fetch the fixtures of a soccer season. func (c *client) FixturesOfTeam(id uint64) TeamFixturesRequest { return TeamFixturesRequest{c.req("teams/%d/fixtures", id)} } diff --git a/req_team_players.go b/req_team_players.go index 5508132..099de3b 100644 --- a/req_team_players.go +++ b/req_team_players.go @@ -2,7 +2,7 @@ package footballdata type TeamPlayersRequest struct{ request } -// Do Executes the request. +// Do executes the request. func (r TeamPlayersRequest) Do() (s PlayerList, err error) { d, _, err := r.doJson("GET") if err != nil { @@ -13,7 +13,7 @@ func (r TeamPlayersRequest) Do() (s PlayerList, err error) { return } -// PlayersOfTeam Prepares a request to fetch a team's players. +// PlayersOfTeam prepares a request to fetch a team's players. func (c *client) PlayersOfTeam(id uint64) TeamPlayersRequest { return TeamPlayersRequest{c.req("teams/%d/players", id)} }