Documentation ¶
Overview ¶
Package gen provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.13.3 DO NOT EDIT.
Package gen provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.13.3 DO NOT EDIT.
Index ¶
- 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 PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- type ChiServerOptions
- type GetTweets200JSONResponse
- type GetTweets400JSONResponse
- type GetTweets500JSONResponse
- type GetTweetsParams
- type GetTweetsParamsCategory
- type GetTweetsRequestObject
- type GetTweetsResponseObject
- type InvalidParamFormatError
- type MiddlewareFunc
- type RequiredHeaderError
- type RequiredParamError
- type ServerInterface
- type ServerInterfaceWrapper
- type StrictHTTPServerOptions
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type TooManyValuesForParamError
- type Tweet
- type UnescapedCookieParamError
- type Unimplemented
- type UnmarshalingParamError
Constants ¶
This section is empty.
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 ChiServerOptions ¶
type ChiServerOptions struct { BaseURL string BaseRouter chi.Router Middlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
type GetTweets200JSONResponse ¶
type GetTweets200JSONResponse []Tweet
func (GetTweets200JSONResponse) VisitGetTweetsResponse ¶
func (response GetTweets200JSONResponse) VisitGetTweetsResponse(w http.ResponseWriter) error
type GetTweets400JSONResponse ¶
type GetTweets400JSONResponse struct {
Message *string `json:"message,omitempty"`
}
func (GetTweets400JSONResponse) VisitGetTweetsResponse ¶
func (response GetTweets400JSONResponse) VisitGetTweetsResponse(w http.ResponseWriter) error
type GetTweets500JSONResponse ¶
type GetTweets500JSONResponse struct {
Message *string `json:"message,omitempty"`
}
func (GetTweets500JSONResponse) VisitGetTweetsResponse ¶
func (response GetTweets500JSONResponse) VisitGetTweetsResponse(w http.ResponseWriter) error
type GetTweetsParams ¶
type GetTweetsParams struct {
Category GetTweetsParamsCategory `form:"category" json:"category"`
}
GetTweetsParams defines parameters for GetTweets.
type GetTweetsParamsCategory ¶
type GetTweetsParamsCategory string
GetTweetsParamsCategory defines parameters for GetTweets.
const ( Like GetTweetsParamsCategory = "like" Own GetTweetsParamsCategory = "own" )
Defines values for GetTweetsParamsCategory.
type GetTweetsRequestObject ¶
type GetTweetsRequestObject struct {
Params GetTweetsParams
}
type GetTweetsResponseObject ¶
type GetTweetsResponseObject interface {
VisitGetTweetsResponse(w http.ResponseWriter) error
}
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 { // (GET /tweets) GetTweets(w http.ResponseWriter, r *http.Request, params GetTweetsParams) }
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) GetTweets ¶
func (siw *ServerInterfaceWrapper) GetTweets(w http.ResponseWriter, r *http.Request)
GetTweets 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 { // (GET /tweets) GetTweets(ctx context.Context, request GetTweetsRequestObject) (GetTweetsResponseObject, error) }
StrictServerInterface represents all server handlers.
type TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type Tweet ¶
type Tweet struct { AddDate string `json:"addDate"` Id int64 `json:"id"` Tags *[]string `json:"tags,omitempty"` Url string `json:"url"` }
Tweet defines model for Tweet.
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) GetTweets ¶
func (_ Unimplemented) GetTweets(w http.ResponseWriter, r *http.Request, params GetTweetsParams)
(GET /tweets)
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error