Documentation ¶
Index ¶
- Variables
- func CacheExpires(r *http.Response) time.Time
- type APIClient
- type APIKey
- type APIResponse
- type ApiResponse
- type BasicAuth
- type CoinToss
- type Configuration
- type EventStatus
- type EventType
- type Filter
- type Game
- type Games
- type GamesApiService
- type GenericOpenAPIError
- type GetGameByIdOpts
- type GetGamesOpts
- type Include
- type LineScore
- type OtLineScore
- type OverTimeLineScore
- type Page
- type PlayByPlay
- type Sort
- type Team
- type Venue
- type Weather
Constants ¶
This section is empty.
Variables ¶
var ( // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. ContextOAuth2 = contextKey("token") // ContextBasicAuth takes BasicAuth as authentication for the request. ContextBasicAuth = contextKey("basic") // ContextAccessToken takes a string oauth2 access token as authentication for the request. ContextAccessToken = contextKey("accesstoken") // ContextAPIKey takes an APIKey as authentication for the request ContextAPIKey = contextKey("apikey") )
Functions ¶
Types ¶
type APIClient ¶
type APIClient struct { GamesApi *GamesApiService // contains filtered or unexported fields }
APIClient manages communication with the CFL API API v1.32 In most cases there should be only one, shared, APIClient.
func NewAPIClient ¶
func NewAPIClient(cfg *Configuration) *APIClient
NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.
func (*APIClient) ChangeBasePath ¶
Change base path to allow switching to mocks
type APIKey ¶
APIKey provides API key based authentication to a request passed via context using ContextAPIKey
type APIResponse ¶
type APIResponse struct { *http.Response `json:"-"` Message string `json:"message,omitempty"` // Operation is the name of the OpenAPI operation. Operation string `json:"operation,omitempty"` // RequestURL is the request URL. This value is always available, even if the // embedded *http.Response is nil. RequestURL string `json:"url,omitempty"` // Method is the HTTP method used for the request. This value is always // available, even if the embedded *http.Response is nil. Method string `json:"method,omitempty"` // Payload holds the contents of the response body (which may be nil or empty). // This is provided here as the raw response.Body() reader will have already // been drained. Payload []byte `json:"-"` }
func NewAPIResponse ¶
func NewAPIResponse(r *http.Response) *APIResponse
func NewAPIResponseWithError ¶
func NewAPIResponseWithError(errorMessage string) *APIResponse
type ApiResponse ¶
type BasicAuth ¶
type BasicAuth struct { UserName string `json:"userName,omitempty"` Password string `json:"password,omitempty"` }
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
type CoinToss ¶
type CoinToss struct { CoinTossWinner string `json:"coin_toss_winner,omitempty"` // A free-form string that contains information on the winner of the game-starting coin toss, and what the team elected to do. The structure of this value is not normalized and as such should be used programmatically with caution. CoinTossWinnerElection string `json:"coin_toss_winner_election,omitempty"` }
type Configuration ¶
type Configuration struct { BasePath string `json:"basePath,omitempty"` Host string `json:"host,omitempty"` Scheme string `json:"scheme,omitempty"` DefaultHeader map[string]string `json:"defaultHeader,omitempty"` UserAgent string `json:"userAgent,omitempty"` HTTPClient *http.Client }
func NewConfiguration ¶
func NewConfiguration() *Configuration
func (*Configuration) AddDefaultHeader ¶
func (c *Configuration) AddDefaultHeader(key string, value string)
type EventStatus ¶
type EventStatus struct { // An integer value indicating the current status of the game. Possible values are: 1: Pre-Game 2: In-Progress 4: Final 9: Cancelled EventStatusId int32 `json:"event_status_id,omitempty"` Name string `json:"name,omitempty"` // A Boolean value indicating if play is currently live in this game. If play is live at the time of the API request, the value returned is true; else it is false. IsActive bool `json:"is_active,omitempty"` // If this game is in progress, contains an integer value indicating the current quarter of play. Contains null if the game is not in play. Quarter int32 `json:"quarter,omitempty"` // If this game is in progress, contains an integer value indicating the last recorded minute value of the game clock. Contains null if the game is not in play. Minutes int32 `json:"minutes,omitempty"` // If this game is in progress, contains an integer value indicating the last recorded second value of the game clock. Contains null if the game is not in play. Seconds int32 `json:"seconds,omitempty"` // If this game is in progress, contains an integer value indicating the down of the last recorded play. Contains null if the game is not in play. Down int32 `json:"down,omitempty"` // If this game is in progress, contains an integer value indicating the last recorded number of yards to a first down. Contains null if the game is not in play. YardsToGo int32 `json:"yards_to_go,omitempty"` }
type EventType ¶
type EventType struct { // An integer value indicating the type of game played. Possible values are: 0: Preseason 1: Regular Season 2: Playoffs 3: Grey Cup EventTypeId int32 `json:"event_type_id,omitempty"` Name string `json:"name,omitempty"` // An string value indicating the formal title of the game. Possible values can include: Blank / No value Eastern Semi-Final Western Semi-Final Eastern Final Western Final XXXth Grey Cup Title string `json:"title,omitempty"` }
type Game ¶
type Game struct { GameId int32 `json:"game_id,omitempty"` DateStart time.Time `json:"date_start,omitempty"` GameNumber int32 `json:"game_number,omitempty"` Week int32 `json:"week,omitempty"` Season int32 `json:"season,omitempty"` Attendance int32 `json:"attendance,omitempty"` GameDuration int32 `json:"game_duration,omitempty"` EventType EventType `json:"event_type,omitempty"` EventStatus EventStatus `json:"event_status,omitempty"` Venue Venue `json:"venue,omitempty"` Weather Weather `json:"weather,omitempty"` CoinToss CoinToss `json:"coin_toss,omitempty"` TicketsUrl string `json:"tickets_url,omitempty"` Team1 Team `json:"team_1,omitempty"` Team2 Team `json:"team_2,omitempty"` PlayByPlay []PlayByPlay `json:"play_by_play,omitempty"` }
type GamesApiService ¶
type GamesApiService service
func (*GamesApiService) GetGameById ¶
func (a *GamesApiService) GetGameById(ctx context.Context, season int32, gameId int32, localVarOptionals *GetGameByIdOpts) (Games, *http.Response, error)
type GenericOpenAPIError ¶
type GenericOpenAPIError struct {
// contains filtered or unexported fields
}
GenericOpenAPIError Provides access to the body, error and model on returned errors.
func (GenericOpenAPIError) Body ¶
func (e GenericOpenAPIError) Body() []byte
Body returns the raw bytes of the response
func (GenericOpenAPIError) Error ¶
func (e GenericOpenAPIError) Error() string
Error returns non-empty string if there was an error.
func (GenericOpenAPIError) Model ¶
func (e GenericOpenAPIError) Model() interface{}
Model returns the unpacked model of the error
type GetGameByIdOpts ¶
type GetGamesOpts ¶
type OtLineScore ¶
type OverTimeLineScore ¶
type PlayByPlay ¶
type PlayByPlay struct { PlayId int32 `json:"play_id,omitempty"` PlaySequence int32 `json:"play_sequence,omitempty"` Quarter int32 `json:"quarter,omitempty"` PlayClockStart string `json:"play_clock_start,omitempty"` PlayClockStartInSecs int32 `json:"play_clock_start_in_secs,omitempty"` FieldPositionStart string `json:"field_position_start,omitempty"` FieldPositionEnd string `json:"field_position_end,omitempty"` Down int32 `json:"down,omitempty"` YardsToGo int32 `json:"yards_to_go,omitempty"` IsInRedZone bool `json:"is_in_red_zone,omitempty"` TeamHomeScore int32 `json:"team_home_score,omitempty"` TeamVisitorScore int32 `json:"team_visitor_score,omitempty"` PlayTypeId int32 `json:"play_type_id,omitempty"` PlayTypeDescription string `json:"play_type_description,omitempty"` PlayResultTypeId int32 `json:"play_result_type_id,omitempty"` PlayResultTypeDescription string `json:"play_result_type_description,omitempty"` PlayResultYards int32 `json:"play_result_yards,omitempty"` PlayResultPoints int32 `json:"play_result_points,omitempty"` PlaySuccessId int32 `json:"play_success_id,omitempty"` PlaySuccessDescription string `json:"play_success_description,omitempty"` PlayChangeOfPossessionOccurred bool `json:"play_change_of_possession_occurred,omitempty"` TeamAbbreviation string `json:"team_abbreviation,omitempty"` TeamId int32 `json:"team_id,omitempty"` PlaySummary string `json:"play_summary,omitempty"` }
type Team ¶
type Team struct { TeamId int32 `json:"team_id,omitempty"` Location string `json:"location,omitempty"` Nickname string `json:"nickname,omitempty"` Abbreviation string `json:"abbreviation,omitempty"` Score int32 `json:"score,omitempty"` VenueId int32 `json:"venue_id,omitempty"` Linescores []map[string]interface{} `json:"linescores,omitempty"` IsAtHome bool `json:"is_at_home,omitempty"` IsWinner bool `json:"is_winner,omitempty"` }
type Weather ¶
type Weather struct { // An integer value indicating the temperature taken at the stadium / venue the game is held at. Note that this value can be zero or negative. Temperature int32 `json:"temperature,omitempty"` Sky string `json:"sky,omitempty"` WindSpeed string `json:"wind_speed,omitempty"` WindDirection string `json:"wind_direction,omitempty"` FieldConditions string `json:"field_conditions,omitempty"` }
Source Files ¶
- api_games.generated.go
- client.generated.go
- configuration.generated.go
- model_api_response.generated.go
- model_coin_toss.generated.go
- model_event_status.generated.go
- model_event_type.generated.go
- model_filter.generated.go
- model_game.generated.go
- model_games.generated.go
- model_include.generated.go
- model_line_score.generated.go
- model_ot_line_score.generated.go
- model_over_time_line_score.generated.go
- model_page.generated.go
- model_play_by_play.generated.go
- model_sort.generated.go
- model_team.generated.go
- model_venue.generated.go
- model_weather.generated.go
- response.generated.go