api

package
v0.0.0-...-e79d758 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: MIT Imports: 4 Imported by: 0

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

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 HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler

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

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap

func (e *InvalidParamFormatError) Unwrap() error

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

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

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 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

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 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

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