Documentation ¶
Overview ¶
Package oapigen provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.13.0 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 EmojiDefinition
- type Error
- type InvalidParamFormatError
- type MiddlewareFunc
- type RequiredHeaderError
- type RequiredParamError
- type ServerInterface
- type ServerInterfaceWrapper
- type StrictHTTPServerOptions
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type Suggest200JSONResponse
- type SuggestJSONBody
- type SuggestJSONBodySort
- type SuggestJSONRequestBody
- type SuggestRequestObject
- type SuggestResponseObject
- type SuggestdefaultJSONResponse
- type TooManyValuesForParamError
- type Translate200JSONResponse
- type TranslateJSONBody
- type TranslateJSONRequestBody
- type TranslateRequestObject
- type TranslateResponseObject
- type TranslatedefaultJSONResponse
- type UnescapedCookieParamError
- type UnmarshallingParamError
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 EmojiDefinition ¶
EmojiDefinition defines model for EmojiDefinition.
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
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 { // (POST /emoji/suggest) Suggest(w http.ResponseWriter, r *http.Request) // (POST /emoji/translate) Translate(w http.ResponseWriter, r *http.Request) }
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) Suggest ¶
func (siw *ServerInterfaceWrapper) Suggest(w http.ResponseWriter, r *http.Request)
Suggest operation middleware
func (*ServerInterfaceWrapper) Translate ¶
func (siw *ServerInterfaceWrapper) Translate(w http.ResponseWriter, r *http.Request)
Translate 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 = runtime.StrictHttpHandlerFunc
type StrictMiddlewareFunc ¶
type StrictMiddlewareFunc = runtime.StrictHttpMiddlewareFunc
type StrictServerInterface ¶
type StrictServerInterface interface { // (POST /emoji/suggest) Suggest(ctx context.Context, request SuggestRequestObject) (SuggestResponseObject, error) // (POST /emoji/translate) Translate(ctx context.Context, request TranslateRequestObject) (TranslateResponseObject, error) }
StrictServerInterface represents all server handlers.
type Suggest200JSONResponse ¶
type Suggest200JSONResponse []EmojiDefinition
func (Suggest200JSONResponse) VisitSuggestResponse ¶
func (response Suggest200JSONResponse) VisitSuggestResponse(w http.ResponseWriter) error
type SuggestJSONBody ¶
type SuggestJSONBody struct { Limit *int `json:"limit,omitempty"` Prefix string `json:"prefix"` Sort SuggestJSONBodySort `json:"sort"` }
SuggestJSONBody defines parameters for Suggest.
type SuggestJSONBodySort ¶
type SuggestJSONBodySort string
SuggestJSONBodySort defines parameters for Suggest.
const ( SuggestJSONBodySortAsc SuggestJSONBodySort = "asc" SuggestJSONBodySortDesc SuggestJSONBodySort = "desc" )
Defines values for SuggestJSONBodySort.
type SuggestJSONRequestBody ¶
type SuggestJSONRequestBody SuggestJSONBody
SuggestJSONRequestBody defines body for Suggest for application/json ContentType.
type SuggestRequestObject ¶
type SuggestRequestObject struct {
Body *SuggestJSONRequestBody
}
type SuggestResponseObject ¶
type SuggestResponseObject interface {
VisitSuggestResponse(w http.ResponseWriter) error
}
type SuggestdefaultJSONResponse ¶
func (SuggestdefaultJSONResponse) VisitSuggestResponse ¶
func (response SuggestdefaultJSONResponse) VisitSuggestResponse(w http.ResponseWriter) error
type TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type Translate200JSONResponse ¶
type Translate200JSONResponse string
func (Translate200JSONResponse) VisitTranslateResponse ¶
func (response Translate200JSONResponse) VisitTranslateResponse(w http.ResponseWriter) error
type TranslateJSONBody ¶
type TranslateJSONBody struct {
Text string `json:"text"`
}
TranslateJSONBody defines parameters for Translate.
type TranslateJSONRequestBody ¶
type TranslateJSONRequestBody TranslateJSONBody
TranslateJSONRequestBody defines body for Translate for application/json ContentType.
type TranslateRequestObject ¶
type TranslateRequestObject struct {
Body *TranslateJSONRequestBody
}
type TranslateResponseObject ¶
type TranslateResponseObject interface {
VisitTranslateResponse(w http.ResponseWriter) error
}
type TranslatedefaultJSONResponse ¶
func (TranslatedefaultJSONResponse) VisitTranslateResponse ¶
func (response TranslatedefaultJSONResponse) VisitTranslateResponse(w http.ResponseWriter) error
type UnescapedCookieParamError ¶
func (*UnescapedCookieParamError) Error ¶
func (e *UnescapedCookieParamError) Error() string
func (*UnescapedCookieParamError) Unwrap ¶
func (e *UnescapedCookieParamError) Unwrap() error
type UnmarshallingParamError ¶
func (*UnmarshallingParamError) Error ¶
func (e *UnmarshallingParamError) Error() string
func (*UnmarshallingParamError) Unwrap ¶
func (e *UnmarshallingParamError) Unwrap() error