Documentation
¶
Overview ¶
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.16.3 DO NOT EDIT.
Index ¶
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
- type ChiServerOptions
- type GetSquadParams
- type InvalidParamFormatError
- type MiddlewareFunc
- type Player
- type RequiredHeaderError
- type RequiredParamError
- type ServerInterface
- type ServerInterfaceWrapper
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type Unimplemented
- type UnmarshalingParamError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
func Handler(si ServerInterface) http.Handler
Handler creates http.Handler with routing matching OpenAPI spec.
func HandlerFromMux ¶
func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
Types ¶
type ChiServerOptions ¶
type ChiServerOptions struct {
BaseURL string
BaseRouter chi.Router
Middlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
type GetSquadParams ¶
type GetSquadParams struct {
// TeamId Squad
TeamId int `form:"teamId" json:"teamId"`
}
GetSquadParams defines parameters for GetSquad.
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type Player ¶
type Player struct {
Age *int `json:"age,omitempty"`
Id *string `json:"id,omitempty"`
MarketValue *int `json:"marketValue,omitempty"`
MarketValueCurrency *string `json:"marketValueCurrency,omitempty"`
Name *string `json:"name,omitempty"`
Position *string `json:"position,omitempty"`
ShirtNumber *string `json:"shirtNumber,omitempty"`
TeamId *int `json:"teamId,omitempty"`
TransfermarktId *string `json:"transfermarktId,omitempty"`
}
Player defines model for Player.
type RequiredHeaderError ¶
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 ServerInterface ¶
type ServerInterface interface {
// Get players for a given team
// (GET /players)
GetSquad(w http.ResponseWriter, r *http.Request, params GetSquadParams)
// Return players
// (GET /players/{playerId})
GetPlayers(w http.ResponseWriter, r *http.Request, playerId string)
}
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
HandlerMiddlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) GetPlayers ¶
func (siw *ServerInterfaceWrapper) GetPlayers(w http.ResponseWriter, r *http.Request)
GetPlayers operation middleware
func (*ServerInterfaceWrapper) GetSquad ¶
func (siw *ServerInterfaceWrapper) GetSquad(w http.ResponseWriter, r *http.Request)
GetSquad operation middleware
type TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type UnescapedCookieParamError ¶
func (*UnescapedCookieParamError) Error ¶
func (e *UnescapedCookieParamError) Error() string
func (*UnescapedCookieParamError) Unwrap ¶
func (e *UnescapedCookieParamError) Unwrap() error
type Unimplemented ¶
type Unimplemented struct{}
func (Unimplemented) GetPlayers ¶
func (_ Unimplemented) GetPlayers(w http.ResponseWriter, r *http.Request, playerId string)
Return players (GET /players/{playerId})
func (Unimplemented) GetSquad ¶
func (_ Unimplemented) GetSquad(w http.ResponseWriter, r *http.Request, params GetSquadParams)
Get players for a given team (GET /players)
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error