Documentation ¶
Overview ¶
Package server provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT.
Index ¶
- Constants
- func GetSwagger() (swagger *openapi3.T, err error)
- 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
- func NewRouter() (http.Handler, error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- type Author
- type BookMetadata
- type ChiServerOptions
- type InvalidParamFormatError
- type MiddlewareFunc
- type N200
- type N200JSONResponse
- type N400
- type N400JSONResponse
- type N401
- type N401JSONResponse
- type N500
- type N500JSONResponse
- type Query
- type RequiredHeaderError
- type RequiredParamError
- type SearchGoodreads200JSONResponse
- type SearchGoodreads400JSONResponse
- type SearchGoodreads401JSONResponse
- type SearchGoodreads500JSONResponse
- type SearchGoodreadsParams
- type SearchGoodreadsRequestObject
- type SearchGoodreadsResponseObject
- type SearchKindle200JSONResponse
- type SearchKindle400JSONResponse
- type SearchKindle401JSONResponse
- type SearchKindle500JSONResponse
- type SearchKindleParams
- type SearchKindleParamsRegion
- type SearchKindleRequestObject
- type SearchKindleResponseObject
- type SeriesMetadata
- type ServerInterface
- type ServerInterfaceWrapper
- type StrictHTTPServerOptions
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type Unimplemented
- type UnmarshalingParamError
Constants ¶
const (
Api_keyScopes = "api_key.Scopes"
)
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.
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 BookMetadata ¶
type BookMetadata struct { Asin *string `json:"asin,omitempty"` Author *string `json:"author,omitempty"` // Cover URL to the cover image Cover *string `json:"cover,omitempty"` Description *string `json:"description,omitempty"` // Duration Duration in seconds Duration *int `json:"duration,omitempty"` Genres *[]string `json:"genres,omitempty"` Isbn *string `json:"isbn,omitempty"` Language *string `json:"language,omitempty"` Narrator *string `json:"narrator,omitempty"` PublishedYear *string `json:"publishedYear,omitempty"` Publisher *string `json:"publisher,omitempty"` Series *[]SeriesMetadata `json:"series,omitempty"` Subtitle *string `json:"subtitle,omitempty"` Tags *[]string `json:"tags,omitempty"` Title string `json:"title"` }
BookMetadata defines model for BookMetadata.
type ChiServerOptions ¶
type ChiServerOptions struct { BaseURL string BaseRouter chi.Router Middlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type N200 ¶
type N200 struct {
Matches *[]BookMetadata `json:"matches,omitempty"`
}
N200 defines model for 200.
type N200JSONResponse ¶
type N200JSONResponse struct {
Matches *[]BookMetadata `json:"matches,omitempty"`
}
type N400JSONResponse ¶
type N400JSONResponse struct {
Error *string `json:"error,omitempty"`
}
type N401JSONResponse ¶
type N401JSONResponse struct {
Error *string `json:"error,omitempty"`
}
type N500JSONResponse ¶
type N500JSONResponse struct {
Error *string `json:"error,omitempty"`
}
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 SearchGoodreads200JSONResponse ¶
type SearchGoodreads200JSONResponse struct{ N200JSONResponse }
func (SearchGoodreads200JSONResponse) VisitSearchGoodreadsResponse ¶
func (response SearchGoodreads200JSONResponse) VisitSearchGoodreadsResponse(w http.ResponseWriter) error
type SearchGoodreads400JSONResponse ¶
type SearchGoodreads400JSONResponse struct{ N400JSONResponse }
func (SearchGoodreads400JSONResponse) VisitSearchGoodreadsResponse ¶
func (response SearchGoodreads400JSONResponse) VisitSearchGoodreadsResponse(w http.ResponseWriter) error
type SearchGoodreads401JSONResponse ¶
type SearchGoodreads401JSONResponse struct{ N401JSONResponse }
func (SearchGoodreads401JSONResponse) VisitSearchGoodreadsResponse ¶
func (response SearchGoodreads401JSONResponse) VisitSearchGoodreadsResponse(w http.ResponseWriter) error
type SearchGoodreads500JSONResponse ¶
type SearchGoodreads500JSONResponse struct{ N500JSONResponse }
func (SearchGoodreads500JSONResponse) VisitSearchGoodreadsResponse ¶
func (response SearchGoodreads500JSONResponse) VisitSearchGoodreadsResponse(w http.ResponseWriter) error
type SearchGoodreadsParams ¶
type SearchGoodreadsParams struct { Query Query `form:"query" json:"query"` Author *Author `form:"author,omitempty" json:"author,omitempty"` }
SearchGoodreadsParams defines parameters for SearchGoodreads.
type SearchGoodreadsRequestObject ¶
type SearchGoodreadsRequestObject struct {
Params SearchGoodreadsParams
}
type SearchGoodreadsResponseObject ¶
type SearchGoodreadsResponseObject interface {
VisitSearchGoodreadsResponse(w http.ResponseWriter) error
}
type SearchKindle200JSONResponse ¶
type SearchKindle200JSONResponse struct{ N200JSONResponse }
func (SearchKindle200JSONResponse) VisitSearchKindleResponse ¶
func (response SearchKindle200JSONResponse) VisitSearchKindleResponse(w http.ResponseWriter) error
type SearchKindle400JSONResponse ¶
type SearchKindle400JSONResponse struct{ N400JSONResponse }
func (SearchKindle400JSONResponse) VisitSearchKindleResponse ¶
func (response SearchKindle400JSONResponse) VisitSearchKindleResponse(w http.ResponseWriter) error
type SearchKindle401JSONResponse ¶
type SearchKindle401JSONResponse struct{ N401JSONResponse }
func (SearchKindle401JSONResponse) VisitSearchKindleResponse ¶
func (response SearchKindle401JSONResponse) VisitSearchKindleResponse(w http.ResponseWriter) error
type SearchKindle500JSONResponse ¶
type SearchKindle500JSONResponse struct{ N500JSONResponse }
func (SearchKindle500JSONResponse) VisitSearchKindleResponse ¶
func (response SearchKindle500JSONResponse) VisitSearchKindleResponse(w http.ResponseWriter) error
type SearchKindleParams ¶
type SearchKindleParams struct { Query Query `form:"query" json:"query"` Author *Author `form:"author,omitempty" json:"author,omitempty"` }
SearchKindleParams defines parameters for SearchKindle.
type SearchKindleParamsRegion ¶
type SearchKindleParamsRegion string
SearchKindleParamsRegion defines parameters for SearchKindle.
const ( Au SearchKindleParamsRegion = "au" Ca SearchKindleParamsRegion = "ca" De SearchKindleParamsRegion = "de" Es SearchKindleParamsRegion = "es" Fr SearchKindleParamsRegion = "fr" In SearchKindleParamsRegion = "in" It SearchKindleParamsRegion = "it" Jp SearchKindleParamsRegion = "jp" Uk SearchKindleParamsRegion = "uk" Us SearchKindleParamsRegion = "us" )
Defines values for SearchKindleParamsRegion.
type SearchKindleRequestObject ¶
type SearchKindleRequestObject struct { Region SearchKindleParamsRegion `json:"region,omitempty"` Params SearchKindleParams }
type SearchKindleResponseObject ¶
type SearchKindleResponseObject interface {
VisitSearchKindleResponse(w http.ResponseWriter) error
}
type SeriesMetadata ¶
type SeriesMetadata struct { Sequence *string `json:"sequence,omitempty"` Series string `json:"series"` }
SeriesMetadata defines model for SeriesMetadata.
type ServerInterface ¶
type ServerInterface interface { // Search for books using goodreads // (GET /goodreads/search) SearchGoodreads(w http.ResponseWriter, r *http.Request, params SearchGoodreadsParams) // Search for books using kindle // (GET /kindle/{region}/search) SearchKindle(w http.ResponseWriter, r *http.Request, region SearchKindleParamsRegion, params SearchKindleParams) }
ServerInterface represents all server handlers.
func NewStrictHandler ¶
func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface
func NewStrictHandlerWithOptions ¶
func NewStrictHandlerWithOptions(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc, options StrictHTTPServerOptions) ServerInterface
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) SearchGoodreads ¶
func (siw *ServerInterfaceWrapper) SearchGoodreads(w http.ResponseWriter, r *http.Request)
SearchGoodreads operation middleware
func (*ServerInterfaceWrapper) SearchKindle ¶
func (siw *ServerInterfaceWrapper) SearchKindle(w http.ResponseWriter, r *http.Request)
SearchKindle operation middleware
type StrictHTTPServerOptions ¶
type StrictHTTPServerOptions struct { RequestErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) ResponseErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
type StrictHandlerFunc ¶
type StrictHandlerFunc = strictnethttp.StrictHTTPHandlerFunc
type StrictMiddlewareFunc ¶
type StrictMiddlewareFunc = strictnethttp.StrictHTTPMiddlewareFunc
type StrictServerInterface ¶
type StrictServerInterface interface { // Search for books using goodreads // (GET /goodreads/search) SearchGoodreads(ctx context.Context, request SearchGoodreadsRequestObject) (SearchGoodreadsResponseObject, error) // Search for books using kindle // (GET /kindle/{region}/search) SearchKindle(ctx context.Context, request SearchKindleRequestObject) (SearchKindleResponseObject, error) }
StrictServerInterface represents all server handlers.
func NewServer ¶
func NewServer() StrictServerInterface
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) SearchGoodreads ¶
func (_ Unimplemented) SearchGoodreads(w http.ResponseWriter, r *http.Request, params SearchGoodreadsParams)
Search for books using goodreads (GET /goodreads/search)
func (Unimplemented) SearchKindle ¶
func (_ Unimplemented) SearchKindle(w http.ResponseWriter, r *http.Request, region SearchKindleParamsRegion, params SearchKindleParams)
Search for books using kindle (GET /kindle/{region}/search)
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error