data

package
v0.0.0-...-51dc31f Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package data provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.

Package data provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.

Package data provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGetConstructorsChampionshipRequest

func NewGetConstructorsChampionshipRequest(server string, year PathYear, params *GetConstructorsChampionshipParams) (*http.Request, error)

NewGetConstructorsChampionshipRequest generates requests for GetConstructorsChampionship

func NewGetDriversChampionshipRequest

func NewGetDriversChampionshipRequest(server string, year PathYear, params *GetDriversChampionshipParams) (*http.Request, error)

NewGetDriversChampionshipRequest generates requests for GetDriversChampionship

func NewGetDriversRequest

func NewGetDriversRequest(server string, params *GetDriversParams) (*http.Request, error)

NewGetDriversRequest generates requests for GetDrivers

func NewGetRaceResultsRequest

func NewGetRaceResultsRequest(server string, raceId PathRaceId, params *GetRaceResultsParams) (*http.Request, error)

NewGetRaceResultsRequest generates requests for GetRaceResults

func NewGetSeasonRacesRequest

func NewGetSeasonRacesRequest(server string, year PathYear, params *GetSeasonRacesParams) (*http.Request, error)

NewGetSeasonRacesRequest generates requests for GetSeasonRaces

func NewGetSeasonsRequest

func NewGetSeasonsRequest(server string, params *GetSeasonsParams) (*http.Request, error)

NewGetSeasonsRequest generates requests for GetSeasons

func RegisterHandlers

func RegisterHandlers(router *mux.Router, si ServerInterface, opts ...ServerOption)

RegisterHandlers registers the api handlers.

func RegisterUnauthedHandlers

func RegisterUnauthedHandlers(router *mux.Router, si ServerInterface, opts ...ServerOption)

RegisterUnauthedHandlers registers any api handlers which do not have any authentication on them. Most services will not have any.

Types

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) GetConstructorsChampionship

func (c *Client) GetConstructorsChampionship(ctx context.Context, year PathYear, params *GetConstructorsChampionshipParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetDrivers

func (c *Client) GetDrivers(ctx context.Context, params *GetDriversParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetDriversChampionship

func (c *Client) GetDriversChampionship(ctx context.Context, year PathYear, params *GetDriversChampionshipParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetRaceResults

func (c *Client) GetRaceResults(ctx context.Context, raceId PathRaceId, params *GetRaceResultsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetSeasonRaces

func (c *Client) GetSeasonRaces(ctx context.Context, year PathYear, params *GetSeasonRacesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetSeasons

func (c *Client) GetSeasons(ctx context.Context, params *GetSeasonsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// GetConstructorsChampionship request
	GetConstructorsChampionship(ctx context.Context, year PathYear, params *GetConstructorsChampionshipParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetDriversChampionship request
	GetDriversChampionship(ctx context.Context, year PathYear, params *GetDriversChampionshipParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetDrivers request
	GetDrivers(ctx context.Context, params *GetDriversParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetRaceResults request
	GetRaceResults(ctx context.Context, raceId PathRaceId, params *GetRaceResultsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetSeasons request
	GetSeasons(ctx context.Context, params *GetSeasonsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetSeasonRaces request
	GetSeasonRaces(ctx context.Context, year PathYear, params *GetSeasonRacesParams, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) GetConstructorsChampionshipWithResponse

func (c *ClientWithResponses) GetConstructorsChampionshipWithResponse(ctx context.Context, year PathYear, params *GetConstructorsChampionshipParams, reqEditors ...RequestEditorFn) (*GetConstructorsChampionshipResponse, error)

GetConstructorsChampionshipWithResponse request returning *GetConstructorsChampionshipResponse

func (*ClientWithResponses) GetDriversChampionshipWithResponse

func (c *ClientWithResponses) GetDriversChampionshipWithResponse(ctx context.Context, year PathYear, params *GetDriversChampionshipParams, reqEditors ...RequestEditorFn) (*GetDriversChampionshipResponse, error)

GetDriversChampionshipWithResponse request returning *GetDriversChampionshipResponse

func (*ClientWithResponses) GetDriversWithResponse

func (c *ClientWithResponses) GetDriversWithResponse(ctx context.Context, params *GetDriversParams, reqEditors ...RequestEditorFn) (*GetDriversResponse, error)

GetDriversWithResponse request returning *GetDriversResponse

func (*ClientWithResponses) GetRaceResultsWithResponse

func (c *ClientWithResponses) GetRaceResultsWithResponse(ctx context.Context, raceId PathRaceId, params *GetRaceResultsParams, reqEditors ...RequestEditorFn) (*GetRaceResultsResponse, error)

GetRaceResultsWithResponse request returning *GetRaceResultsResponse

func (*ClientWithResponses) GetSeasonRacesWithResponse

func (c *ClientWithResponses) GetSeasonRacesWithResponse(ctx context.Context, year PathYear, params *GetSeasonRacesParams, reqEditors ...RequestEditorFn) (*GetSeasonRacesResponse, error)

GetSeasonRacesWithResponse request returning *GetSeasonRacesResponse

func (*ClientWithResponses) GetSeasonsWithResponse

func (c *ClientWithResponses) GetSeasonsWithResponse(ctx context.Context, params *GetSeasonsParams, reqEditors ...RequestEditorFn) (*GetSeasonsResponse, error)

GetSeasonsWithResponse request returning *GetSeasonsResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GetConstructorsChampionshipWithResponse request
	GetConstructorsChampionshipWithResponse(ctx context.Context, year PathYear, params *GetConstructorsChampionshipParams, reqEditors ...RequestEditorFn) (*GetConstructorsChampionshipResponse, error)

	// GetDriversChampionshipWithResponse request
	GetDriversChampionshipWithResponse(ctx context.Context, year PathYear, params *GetDriversChampionshipParams, reqEditors ...RequestEditorFn) (*GetDriversChampionshipResponse, error)

	// GetDriversWithResponse request
	GetDriversWithResponse(ctx context.Context, params *GetDriversParams, reqEditors ...RequestEditorFn) (*GetDriversResponse, error)

	// GetRaceResultsWithResponse request
	GetRaceResultsWithResponse(ctx context.Context, raceId PathRaceId, params *GetRaceResultsParams, reqEditors ...RequestEditorFn) (*GetRaceResultsResponse, error)

	// GetSeasonsWithResponse request
	GetSeasonsWithResponse(ctx context.Context, params *GetSeasonsParams, reqEditors ...RequestEditorFn) (*GetSeasonsResponse, error)

	// GetSeasonRacesWithResponse request
	GetSeasonRacesWithResponse(ctx context.Context, year PathYear, params *GetSeasonRacesParams, reqEditors ...RequestEditorFn) (*GetSeasonRacesResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type ConstructorChampionship

type ConstructorChampionship struct {
	Id       *int64   `json:"id,omitempty"`
	Name     *string  `json:"name,omitempty"`
	Points   *float32 `json:"points,omitempty"`
	Position *int64   `json:"position,omitempty"`
}

ConstructorChampionship defines the model for constructor_championship.

type ConstructorChampionshipResponse

type ConstructorChampionshipResponse struct {
	Constructors []ConstructorChampionship `json:"constructors"`
	Total        int64                     `json:"total"`
}

ConstructorChampionshipResponse defines the model for constructor_championship_response.

type Driver

type Driver struct {
	Name        *string `json:"name,omitempty"`
	Nationality *string `json:"nationality,omitempty"`
	Tag         *string `json:"tag,omitempty"`
}

Driver defines the model for driver.

type DriverChampionship

type DriverChampionship struct {
	Id          *int64   `json:"id,omitempty"`
	Name        *string  `json:"name,omitempty"`
	Nationality *string  `json:"nationality,omitempty"`
	Points      *float32 `json:"points,omitempty"`
	Position    *int64   `json:"position,omitempty"`
	Tag         *string  `json:"tag,omitempty"`
	Team        *string  `json:"team,omitempty"`
}

DriverChampionship defines the model for driver_championship.

type DriverChampionshipResponse

type DriverChampionshipResponse struct {
	Drivers []DriverChampionship `json:"drivers"`
	Total   int64                `json:"total"`
}

DriverChampionshipResponse defines the model for driver_championship_response.

type DriverResponse

type DriverResponse struct {
	Drivers []Driver `json:"drivers"`
	Total   int64    `json:"total"`
}

DriverResponse defines the model for driver_response.

type ErrorHandlerFunc

type ErrorHandlerFunc = func(http.ResponseWriter, *http.Request, error)

type GetConstructorsChampionshipParams

type GetConstructorsChampionshipParams struct {
	// Limit Report type
	Limit *externalRef0.LimitParam `form:"limit,omitempty" json:"limit,omitempty"`

	// LastVal Pagination details, last value of the sort column on the previous page.
	LastVal *externalRef0.LastValue `form:"last_val,omitempty" json:"last_val,omitempty"`

	// LastId Pagination details, last value of the id column on the previous page.
	LastId *externalRef0.LastId `form:"last_id,omitempty" json:"last_id,omitempty"`

	// SortBy Pagination details, sort column, if empty uses the id column.
	SortBy *externalRef0.SortBy `form:"sort_by,omitempty" json:"sort_by,omitempty"`

	// SortDir Pagination details, sorting order.
	SortDir *GetConstructorsChampionshipParamsSortDir `form:"sort_dir,omitempty" json:"sort_dir,omitempty"`

	// Name The name to filter by
	Name *QueryName `form:"name,omitempty" json:"name,omitempty"`
}

GetConstructorsChampionshipParams defines parameters for GetConstructorsChampionship.

type GetConstructorsChampionshipParamsSortDir

type GetConstructorsChampionshipParamsSortDir string

GetConstructorsChampionshipParamsSortDir defines parameters for GetConstructorsChampionship.

type GetConstructorsChampionshipResponse

type GetConstructorsChampionshipResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ConstructorChampionshipResponse
	JSON400      *externalRef0.ErrorMessage
	JSON404      *externalRef0.Message
	JSON500      *externalRef0.ErrorMessage
}

func ParseGetConstructorsChampionshipResponse

func ParseGetConstructorsChampionshipResponse(rsp *http.Response) (*GetConstructorsChampionshipResponse, error)

ParseGetConstructorsChampionshipResponse parses an HTTP response from a GetConstructorsChampionshipWithResponse call

func (GetConstructorsChampionshipResponse) Status

Status returns HTTPResponse.Status

func (GetConstructorsChampionshipResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type GetDriversChampionshipParams

type GetDriversChampionshipParams struct {
	// Limit Report type
	Limit *externalRef0.LimitParam `form:"limit,omitempty" json:"limit,omitempty"`

	// LastVal Pagination details, last value of the sort column on the previous page.
	LastVal *externalRef0.LastValue `form:"last_val,omitempty" json:"last_val,omitempty"`

	// LastId Pagination details, last value of the id column on the previous page.
	LastId *externalRef0.LastId `form:"last_id,omitempty" json:"last_id,omitempty"`

	// SortBy Pagination details, sort column, if empty uses the id column.
	SortBy *externalRef0.SortBy `form:"sort_by,omitempty" json:"sort_by,omitempty"`

	// SortDir Pagination details, sorting order.
	SortDir *GetDriversChampionshipParamsSortDir `form:"sort_dir,omitempty" json:"sort_dir,omitempty"`

	// Name The name to filter by
	Name *QueryName `form:"name,omitempty" json:"name,omitempty"`

	// Tag The tag to filter by
	Tag *QueryTag `form:"tag,omitempty" json:"tag,omitempty"`

	// Team The team to filter by
	Team *QueryTeam `form:"team,omitempty" json:"team,omitempty"`
}

GetDriversChampionshipParams defines parameters for GetDriversChampionship.

type GetDriversChampionshipParamsSortDir

type GetDriversChampionshipParamsSortDir string

GetDriversChampionshipParamsSortDir defines parameters for GetDriversChampionship.

type GetDriversChampionshipResponse

type GetDriversChampionshipResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *DriverChampionshipResponse
	JSON400      *externalRef0.ErrorMessage
	JSON404      *externalRef0.Message
	JSON500      *externalRef0.ErrorMessage
}

func ParseGetDriversChampionshipResponse

func ParseGetDriversChampionshipResponse(rsp *http.Response) (*GetDriversChampionshipResponse, error)

ParseGetDriversChampionshipResponse parses an HTTP response from a GetDriversChampionshipWithResponse call

func (GetDriversChampionshipResponse) Status

Status returns HTTPResponse.Status

func (GetDriversChampionshipResponse) StatusCode

func (r GetDriversChampionshipResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetDriversParams

type GetDriversParams struct {
	// Limit Report type
	Limit *externalRef0.LimitParam `form:"limit,omitempty" json:"limit,omitempty"`

	// LastVal Pagination details, last value of the sort column on the previous page.
	LastVal *externalRef0.LastValue `form:"last_val,omitempty" json:"last_val,omitempty"`

	// LastId Pagination details, last value of the id column on the previous page.
	LastId *externalRef0.LastId `form:"last_id,omitempty" json:"last_id,omitempty"`

	// SortBy Pagination details, sort column, if empty uses the id column.
	SortBy *externalRef0.SortBy `form:"sort_by,omitempty" json:"sort_by,omitempty"`

	// SortDir Pagination details, sorting order.
	SortDir *GetDriversParamsSortDir `form:"sort_dir,omitempty" json:"sort_dir,omitempty"`

	// Name The name to filter by
	Name *QueryName `form:"name,omitempty" json:"name,omitempty"`

	// Tag The tag to filter by
	Tag *QueryTag `form:"tag,omitempty" json:"tag,omitempty"`

	// Team The team to filter by
	Team *QueryTeam `form:"team,omitempty" json:"team,omitempty"`

	// Nationality The nationality to filter by
	Nationality *QueryNationality `form:"nationality,omitempty" json:"nationality,omitempty"`
}

GetDriversParams defines parameters for GetDrivers.

type GetDriversParamsSortDir

type GetDriversParamsSortDir string

GetDriversParamsSortDir defines parameters for GetDrivers.

type GetDriversResponse

type GetDriversResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *DriverResponse
	JSON400      *externalRef0.ErrorMessage
	JSON500      *externalRef0.ErrorMessage
}

func ParseGetDriversResponse

func ParseGetDriversResponse(rsp *http.Response) (*GetDriversResponse, error)

ParseGetDriversResponse parses an HTTP response from a GetDriversWithResponse call

func (GetDriversResponse) Status

func (r GetDriversResponse) Status() string

Status returns HTTPResponse.Status

func (GetDriversResponse) StatusCode

func (r GetDriversResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetRaceResultsParams

type GetRaceResultsParams struct {
	// Limit Report type
	Limit *externalRef0.LimitParam `form:"limit,omitempty" json:"limit,omitempty"`

	// LastVal Pagination details, last value of the sort column on the previous page.
	LastVal *externalRef0.LastValue `form:"last_val,omitempty" json:"last_val,omitempty"`

	// LastId Pagination details, last value of the id column on the previous page.
	LastId *externalRef0.LastId `form:"last_id,omitempty" json:"last_id,omitempty"`

	// SortBy Pagination details, sort column, if empty uses the id column.
	SortBy *externalRef0.SortBy `form:"sort_by,omitempty" json:"sort_by,omitempty"`

	// SortDir Pagination details, sorting order.
	SortDir *GetRaceResultsParamsSortDir `form:"sort_dir,omitempty" json:"sort_dir,omitempty"`
}

GetRaceResultsParams defines parameters for GetRaceResults.

type GetRaceResultsParamsSortDir

type GetRaceResultsParamsSortDir string

GetRaceResultsParamsSortDir defines parameters for GetRaceResults.

type GetRaceResultsResponse

type GetRaceResultsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *RaceResultResponse
	JSON400      *externalRef0.ErrorMessage
	JSON404      *externalRef0.Message
	JSON500      *externalRef0.ErrorMessage
}

func ParseGetRaceResultsResponse

func ParseGetRaceResultsResponse(rsp *http.Response) (*GetRaceResultsResponse, error)

ParseGetRaceResultsResponse parses an HTTP response from a GetRaceResultsWithResponse call

func (GetRaceResultsResponse) Status

func (r GetRaceResultsResponse) Status() string

Status returns HTTPResponse.Status

func (GetRaceResultsResponse) StatusCode

func (r GetRaceResultsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetSeasonRacesParams

type GetSeasonRacesParams struct {
	// Limit Report type
	Limit *externalRef0.LimitParam `form:"limit,omitempty" json:"limit,omitempty"`

	// LastVal Pagination details, last value of the sort column on the previous page.
	LastVal *externalRef0.LastValue `form:"last_val,omitempty" json:"last_val,omitempty"`

	// LastId Pagination details, last value of the id column on the previous page.
	LastId *externalRef0.LastId `form:"last_id,omitempty" json:"last_id,omitempty"`

	// SortBy Pagination details, sort column, if empty uses the id column.
	SortBy *externalRef0.SortBy `form:"sort_by,omitempty" json:"sort_by,omitempty"`

	// SortDir Pagination details, sorting order.
	SortDir *GetSeasonRacesParamsSortDir `form:"sort_dir,omitempty" json:"sort_dir,omitempty"`
}

GetSeasonRacesParams defines parameters for GetSeasonRaces.

type GetSeasonRacesParamsSortDir

type GetSeasonRacesParamsSortDir string

GetSeasonRacesParamsSortDir defines parameters for GetSeasonRaces.

type GetSeasonRacesResponse

type GetSeasonRacesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *RaceResponse
	JSON400      *externalRef0.ErrorMessage
	JSON404      *externalRef0.Message
	JSON500      *externalRef0.ErrorMessage
}

func ParseGetSeasonRacesResponse

func ParseGetSeasonRacesResponse(rsp *http.Response) (*GetSeasonRacesResponse, error)

ParseGetSeasonRacesResponse parses an HTTP response from a GetSeasonRacesWithResponse call

func (GetSeasonRacesResponse) Status

func (r GetSeasonRacesResponse) Status() string

Status returns HTTPResponse.Status

func (GetSeasonRacesResponse) StatusCode

func (r GetSeasonRacesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetSeasonsParams

type GetSeasonsParams struct {
	// Limit Report type
	Limit *externalRef0.LimitParam `form:"limit,omitempty" json:"limit,omitempty"`

	// LastVal Pagination details, last value of the sort column on the previous page.
	LastVal *externalRef0.LastValue `form:"last_val,omitempty" json:"last_val,omitempty"`

	// LastId Pagination details, last value of the id column on the previous page.
	LastId *externalRef0.LastId `form:"last_id,omitempty" json:"last_id,omitempty"`

	// SortBy Pagination details, sort column, if empty uses the id column.
	SortBy *externalRef0.SortBy `form:"sort_by,omitempty" json:"sort_by,omitempty"`

	// SortDir Pagination details, sorting order.
	SortDir *GetSeasonsParamsSortDir `form:"sort_dir,omitempty" json:"sort_dir,omitempty"`

	// Year The year of the season
	Year *QueryYear `form:"year,omitempty" json:"year,omitempty"`

	// YearMin The minimum year of the season
	YearMin *QueryYearMin `form:"year_min,omitempty" json:"year_min,omitempty"`

	// YearMax The maximum year of the season
	YearMax *QueryYearMax `form:"year_max,omitempty" json:"year_max,omitempty"`
}

GetSeasonsParams defines parameters for GetSeasons.

type GetSeasonsParamsSortDir

type GetSeasonsParamsSortDir string

GetSeasonsParamsSortDir defines parameters for GetSeasons.

type GetSeasonsResponse

type GetSeasonsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *SeasonResponse
	JSON400      *externalRef0.ErrorMessage
	JSON500      *externalRef0.ErrorMessage
}

func ParseGetSeasonsResponse

func ParseGetSeasonsResponse(rsp *http.Response) (*GetSeasonsResponse, error)

ParseGetSeasonsResponse parses an HTTP response from a GetSeasonsWithResponse call

func (GetSeasonsResponse) Status

func (r GetSeasonsResponse) Status() string

Status returns HTTPResponse.Status

func (GetSeasonsResponse) StatusCode

func (r GetSeasonsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type InvalidParamFormatError

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap

func (e *InvalidParamFormatError) Unwrap() error

type MetricsMiddlewareFunc

type MetricsMiddlewareFunc = http.HandlerFunc

type PathRaceId

type PathRaceId = int64

PathRaceId defines the model for path_race_id.

type PathYear

type PathYear = int64

PathYear defines the model for path_year.

type QueryName

type QueryName = string

QueryName defines the model for query_name.

type QueryNationality

type QueryNationality = string

QueryNationality defines the model for query_nationality.

type QueryTag

type QueryTag = string

QueryTag defines the model for query_tag.

type QueryTeam

type QueryTeam = string

QueryTeam defines the model for query_team.

type QueryYear

type QueryYear = int64

QueryYear defines the model for query_year.

type QueryYearMax

type QueryYearMax = int64

QueryYearMax defines the model for query_year_max.

type QueryYearMin

type QueryYearMin = int64

QueryYearMin defines the model for query_year_min.

type Race

type Race struct {
	Date *openapi_types.Date `json:"date,omitempty"`
	Id   *int64              `json:"id,omitempty"`
	Name *string             `json:"name,omitempty"`
}

Race defines the model for race.

type RaceResponse

type RaceResponse struct {
	Races []Race `json:"races"`
	Total int64  `json:"total"`
}

RaceResponse defines the model for race_response.

type RaceResult

type RaceResult struct {
	DriverName    *string  `json:"driver_name,omitempty"`
	DriverNumber  *int64   `json:"driver_number,omitempty"`
	DriverTag     *string  `json:"driver_tag,omitempty"`
	Id            *int64   `json:"id,omitempty"`
	LapsCompleted *int64   `json:"laps_completed,omitempty"`
	Points        *float32 `json:"points,omitempty"`
	Position      *string  `json:"position,omitempty"`
	TeamName      *string  `json:"team_name,omitempty"`
	TimeOrRetired *string  `json:"time_or_retired,omitempty"`
}

RaceResult defines the model for race_result.

type RaceResultResponse

type RaceResultResponse struct {
	Results []RaceResult `json:"results"`
	Total   int64        `json:"total"`
}

RaceResultResponse defines the model for race_result_response.

type RateLimiterFunc

type RateLimiterFunc = func(http.ResponseWriter, *http.Request) error

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type RequiredHeaderError

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

func (*RequiredHeaderError) Error

func (e *RequiredHeaderError) Error() string

func (*RequiredHeaderError) Unwrap

func (e *RequiredHeaderError) Unwrap() error

type RequiredParamError

type RequiredParamError struct {
	ParamName string
}

func (*RequiredParamError) Error

func (e *RequiredParamError) Error() string

type Season

type Season struct {
	Id   *int64 `json:"id,omitempty"`
	Year *int64 `json:"year,omitempty"`
}

Season defines the model for season.

type SeasonResponse

type SeasonResponse struct {
	Seasons []Season `json:"seasons"`
	Total   int64    `json:"total"`
}

SeasonResponse defines the model for season_response.

type ServerInterface

type ServerInterface interface {
	// Get all drivers for a season
	// (GET /championships/{year}/constructors)
	GetConstructorsChampionship(w http.ResponseWriter, r *http.Request, year PathYear, params GetConstructorsChampionshipParams)
	// Get all drivers for a season
	// (GET /championships/{year}/drivers)
	GetDriversChampionship(w http.ResponseWriter, r *http.Request, year PathYear, params GetDriversChampionshipParams)
	// Get all drivers
	// (GET /drivers)
	GetDrivers(w http.ResponseWriter, r *http.Request, params GetDriversParams)
	// Get all results for a season
	// (GET /races/{race_id}/results)
	GetRaceResults(w http.ResponseWriter, r *http.Request, raceId PathRaceId, params GetRaceResultsParams)
	// Get all seasons
	// (GET /seasons)
	GetSeasons(w http.ResponseWriter, r *http.Request, params GetSeasonsParams)
	// Get all races for a season
	// (GET /seasons/{year}/races)
	GetSeasonRaces(w http.ResponseWriter, r *http.Request, year PathYear, params GetSeasonRacesParams)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	// contains filtered or unexported fields
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) GetConstructorsChampionship

func (siw *ServerInterfaceWrapper) GetConstructorsChampionship(w http.ResponseWriter, r *http.Request)

GetConstructorsChampionship operation middleware

func (*ServerInterfaceWrapper) GetDrivers

func (siw *ServerInterfaceWrapper) GetDrivers(w http.ResponseWriter, r *http.Request)

GetDrivers operation middleware

func (*ServerInterfaceWrapper) GetDriversChampionship

func (siw *ServerInterfaceWrapper) GetDriversChampionship(w http.ResponseWriter, r *http.Request)

GetDriversChampionship operation middleware

func (*ServerInterfaceWrapper) GetRaceResults

func (siw *ServerInterfaceWrapper) GetRaceResults(w http.ResponseWriter, r *http.Request)

GetRaceResults operation middleware

func (*ServerInterfaceWrapper) GetSeasonRaces

func (siw *ServerInterfaceWrapper) GetSeasonRaces(w http.ResponseWriter, r *http.Request)

GetSeasonRaces operation middleware

func (*ServerInterfaceWrapper) GetSeasons

func (siw *ServerInterfaceWrapper) GetSeasons(w http.ResponseWriter, r *http.Request)

GetSeasons operation middleware

type ServerOption

type ServerOption func(s *ServerInterfaceWrapper)

ServerOption represents an optional feature applied to the server.

func WithAuthorization

func WithAuthorization(authz ServerInterface) ServerOption

WithAuthorization applies the passed authorization middleware to the server.

func WithErrorHandlerFunc

func WithErrorHandlerFunc(errorHandlerFunc ErrorHandlerFunc) ServerOption

WithErrorHandlerFunc sets the error handler function for the server.

func WithMetricsMiddleware

func WithMetricsMiddleware(middleware MetricsMiddlewareFunc) ServerOption

WithMetricsMiddleware applies the metrics middleware to the server.

func WithRateLimiter

func WithRateLimiter(rateLimiter RateLimiterFunc) ServerOption

WithRateLimiter applies the rate limiter middleware to routes with x-global-rate-limit.

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type UnescapedCookieParamError

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap

func (e *UnescapedCookieParamError) Unwrap() error

type UnmarshalingParamError

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

Jump to

Keyboard shortcuts

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