tba

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2020 License: MIT Imports: 7 Imported by: 0

README

Unofficial Go TBA API

GitHub GoDoc

This is a wrapper of The Blue Alliance Read-Only v3 API for Golang. It supports the If-Modified-Since header to prefer cached data over new data and a custom User-Agent header. Authentication with the client is done by passing your API key to each function on calling. Unlike the auto-generated one, this only uses the standard library and thus requires no dependencies.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidToken = errors.New("invalid api token")

Error constants

View Source
var ErrYearOutOfBounds = errors.New("year out of bounds")

Functions

func DistrictEventKeys

func DistrictEventKeys(district, apiKey string, opts *RequestOptions) ([]string, int, error)

Get the keys of the events associated with a district

func DistrictEvents

func DistrictEvents(district, apiKey string, opts *RequestOptions) ([]responses.Event, int, error)

Get events associated with a district

func DistrictEventsSimple

func DistrictEventsSimple(district, apiKey string, opts *RequestOptions) ([]responses.EventSimple, int, error)

Get a simplified list of events associated with a district

func DistrictRankings

func DistrictRankings(district, apiKey string, opts *RequestOptions) ([]responses.DistrictRanking, int, error)

Get the rankings of teams in a district

func DistrictTeamKeys

func DistrictTeamKeys(district, apiKey string, opts *RequestOptions) ([]string, int, error)

Get the keys of the teams associated with a district

func DistrictTeams

func DistrictTeams(district, apiKey string, opts *RequestOptions) ([]responses.Team, int, error)

Get the teams associated with a district

func DistrictTeamsSimple

func DistrictTeamsSimple(district, apiKey string, opts *RequestOptions) ([]responses.TeamSimple, int, error)

Get a simplified list of the teams associated with a district

func DistrictsByYear

func DistrictsByYear(year int64, apiKey string, opts *RequestOptions) ([]responses.DistrictList, int, error)

Get the districts for a certain year

func Event

func Event(key, apiKey string, opts *RequestOptions) (*responses.Event, int, error)

Get a single event by its key

func EventAlliances

func EventAlliances(key, apiKey string, opts *RequestOptions) ([]responses.EventAlliance, int, error)

Get the alliances in an event

func EventAwards

func EventAwards(event, apiKey string, opts *RequestOptions) ([]responses.Award, int, error)

Get awards given at an event

func EventDistrictPoints

func EventDistrictPoints(key, apiKey string, opts *RequestOptions) (*responses.EventDistrictPoints, int, error)

Get district points for a given event

func EventInsights

func EventInsights(key string, year int64, apiKey string, opts *RequestOptions) (interface{}, int, error)

Get the insights for an event. The year must be between 2016 and 2019, inclusive.

func EventMatchKeys

func EventMatchKeys(event, apiKey string, opts *RequestOptions) ([]string, int, error)

Get the keys of the matches of an event

func EventMatches

func EventMatches(event, apiKey string, opts *RequestOptions) ([]responses.Match, int, error)

Get the matches of an event

func EventMatchesSimple

func EventMatchesSimple(event, apiKey string, opts *RequestOptions) ([]responses.MatchSimple, int, error)

Get a simple representation of the matches of an event

func EventOPRs

func EventOPRs(key, apiKey string, opts *RequestOptions) (*responses.EventOPRs, int, error)

Get OPRs, DPRs, and CCWMs for a given event

func EventPredictions

func EventPredictions(key, apiKey string, opts *RequestOptions) (*responses.EventPredictions, int, error)

Get predictions for a given event

func EventRankings

func EventRankings(key, apiKey string, opts *RequestOptions) (*responses.EventRanking, int, error)

Get rankings for a given event

func EventSimple

func EventSimple(key, apiKey string, opts *RequestOptions) (*responses.EventSimple, int, error)

Get the simple representation of a single event by its key

func EventTeamKeys

func EventTeamKeys(key, apiKey string, opts *RequestOptions) ([]string, int, error)

Get teams in an event

func EventTeamStatuses

func EventTeamStatuses(event, apiKey string, opts *RequestOptions) ([]responses.TeamEventStatus, int, error)

Get the statuses of the teams at a given event

func EventTeams

func EventTeams(key, apiKey string, opts *RequestOptions) ([]responses.Team, int, error)

Get teams in an event

func EventTeamsSimple

func EventTeamsSimple(key, apiKey string, opts *RequestOptions) ([]responses.TeamSimple, int, error)

Get teams in an event

func EventTimeseries

func EventTimeseries(event, apiKey string, opts *RequestOptions) ([]string, int, error)

Get matches with timeseries data for an event

func ListEventKeys

func ListEventKeys(year int64, apiKey string, opts *RequestOptions) ([]string, int, error)

Get the keys of events for a given year.

func ListEvents

func ListEvents(year int64, apiKey string, opts *RequestOptions) ([]responses.Event, int, error)

Get a list of events for a given year.

func ListEventsSimple

func ListEventsSimple(year int64, apiKey string, opts *RequestOptions) ([]responses.EventSimple, int, error)

Get a simplified list of events for a given year.

func ListTeamKeys

func ListTeamKeys(page int64, apiKey string, opts *RequestOptions) ([]string, int, error)

Get a list of team keys in the TBA database. The response is paginated by team numbers in sets of 500. The set of 500 is not number of teams, but the range of team numbers.

func ListTeams

func ListTeams(page int64, apiKey string, opts *RequestOptions) ([]responses.Team, int, error)

Get a list of teams in the TBA database. The response is paginated by team numbers in sets of 500. The set of 500 is not number of teams, but the range of team numbers.

func ListTeamsByYear

func ListTeamsByYear(year, page int64, apiKey string, opts *RequestOptions) ([]responses.Team, int, error)

Get a list of teams in the TBA database for a specific year. The response is paginated by team numbers in sets of 500. The set of 500 is not number of teams, but the range of team numbers.

func ListTeamsByYearKey

func ListTeamsByYearKey(year, page int64, apiKey string, opts *RequestOptions) ([]string, int, error)

Get a list of team keys in the TBA database for a specific year. The response is paginated by team numbers in sets of 500. The set of 500 is not number of teams, but the range of team numbers.

func ListTeamsByYearSimple

func ListTeamsByYearSimple(year, page int64, apiKey string, opts *RequestOptions) ([]responses.TeamSimple, int, error)

Get a list of teams with simplified data in the TBA database for a specific year. The response is paginated by team numbers in sets of 500. The set of 500 is not number of teams, but the range of team numbers.

func ListTeamsSimple

func ListTeamsSimple(page int64, apiKey string, opts *RequestOptions) ([]responses.TeamSimple, int, error)

Get a list of teams with simplified data in the TBA database. The response is paginated by team numbers in sets of 500. The set of 500 is not number of teams, but the range of team numbers.

func Match

func Match(key, apiKey string, opts *RequestOptions) (*responses.Match, int, error)

Get information about a match

func MatchSimple

func MatchSimple(key, apiKey string, opts *RequestOptions) (*responses.MatchSimple, int, error)

Get a simplified information about a match

func MatchTimeseries

func MatchTimeseries(key, apiKey string, opts *RequestOptions) (*responses.Timeseries2018, int, error)

Get timeseries information about a match

func Status

func Status(apiKey string, opts *RequestOptions) (*responses.ApiStatus, int, error)

Get the status of the TBA API and internal status information

func Team

func Team(team, apiKey string, opts *RequestOptions) (*responses.Team, int, error)

Get a team's information by their key

func TeamAwards

func TeamAwards(team, apiKey string, opts *RequestOptions) ([]responses.Award, int, error)

Get all the awards a team has received

func TeamAwardsByYear

func TeamAwardsByYear(team string, year int64, apiKey string, opts *RequestOptions) ([]responses.Award, int, error)

Get a list of awards given to a team in a given year

func TeamDistricts

func TeamDistricts(team, apiKey string, opts *RequestOptions) ([]responses.DistrictList, int, error)

Get a list of the districts a team is in

func TeamEventAwards

func TeamEventAwards(team, event, apiKey string, opts *RequestOptions) ([]responses.Award, int, error)

Get the awards for a team at an event

func TeamEventKeys

func TeamEventKeys(team, apiKey string, opts *RequestOptions) ([]string, int, error)

Get a list of keys for events a team is in

func TeamEventMatchKeys

func TeamEventMatchKeys(team, event, apiKey string, opts *RequestOptions) ([]string, int, error)

Get a simplified list of matches a team is in for an event

func TeamEventMatches

func TeamEventMatches(team, event, apiKey string, opts *RequestOptions) ([]responses.Match, int, error)

Get a list of matches a team is in for an event

func TeamEventMatchesSimple

func TeamEventMatchesSimple(team, event, apiKey string, opts *RequestOptions) ([]responses.MatchSimple, int, error)

Get a simplified list of matches a team is in for an event

func TeamEventStatus

func TeamEventStatus(team, event, apiKey string, opts *RequestOptions) (*responses.TeamEventStatus, int, error)

Get the status of a team at an event

func TeamEventStatusesByYear

func TeamEventStatusesByYear(team string, year int64, apiKey string, opts *RequestOptions) (map[string]responses.TeamEventStatus, int, error)

Get a map of a team's statuses for events in a given year

func TeamEvents

func TeamEvents(team, apiKey string, opts *RequestOptions) ([]responses.Event, int, error)

Get a list of events a team is in

func TeamEventsByYear

func TeamEventsByYear(team string, year int64, apiKey string, opts *RequestOptions) ([]responses.Event, int, error)

Get a list of events a team is in for a given year

func TeamEventsByYearKey

func TeamEventsByYearKey(team string, year int64, apiKey string, opts *RequestOptions) ([]string, int, error)

Get a list of keys for events a team is in for a given year

func TeamEventsByYearSimple

func TeamEventsByYearSimple(team string, year int64, apiKey string, opts *RequestOptions) ([]responses.EventSimple, int, error)

Get a simplified list of events a team is in for a given year

func TeamEventsSimple

func TeamEventsSimple(team, apiKey string, opts *RequestOptions) ([]responses.EventSimple, int, error)

Get a simplified list of events a team is in

func TeamMatchesByYear

func TeamMatchesByYear(team string, year int64, apiKey string, opts *RequestOptions) ([]responses.Match, int, error)

Get the matches a team was in for a given year

func TeamMatchesByYearKey

func TeamMatchesByYearKey(team string, year int64, apiKey string, opts *RequestOptions) ([]string, int, error)

Get the keys of the matches a team was in for a given year

func TeamMatchesByYearSimple

func TeamMatchesByYearSimple(team string, year int64, apiKey string, opts *RequestOptions) ([]responses.MatchSimple, int, error)

Get a simplified list of matches a team was in for a given year

func TeamMediaByTag

func TeamMediaByTag(team, tag, apiKey string, opts *RequestOptions) ([]responses.Media, int, error)

Get a list of media for a given team with a given tag

func TeamMediaByTagAndYear

func TeamMediaByTagAndYear(team, tag string, year int64, apiKey string, opts *RequestOptions) ([]responses.Media, int, error)

Get a list of media for a given team with a given tag and year

func TeamMediaByYear

func TeamMediaByYear(team string, year int64, apiKey string, opts *RequestOptions) ([]responses.Media, int, error)

Get the media of a team for a given year

func TeamRobots

func TeamRobots(team, apiKey string, opts *RequestOptions) ([]responses.TeamRobot, int, error)

Get a list of named robots associated with a given team

func TeamSimple

func TeamSimple(team, apiKey string, opts *RequestOptions) (*responses.TeamSimple, int, error)

Get the simplified data of a team

func TeamSocialMedia

func TeamSocialMedia(team, apiKey string, opts *RequestOptions) ([]responses.Media, int, error)

Get a list of social media for a team

func YearsTeamParticipated

func YearsTeamParticipated(team, apiKey string, opts *RequestOptions) ([]int, int, error)

Get the years in which a team participated in competition

Types

type RequestOptions

type RequestOptions struct {
	// The value for the Last-Modified header.
	LastModified *time.Time
	// Set a custom user agent header instead of the default Golang user agent.
	UserAgent *string
}

Additional configuration options for the request being sent

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL