Documentation ¶
Overview ¶
Package openapi 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 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 InvalidParamFormatError
- type MiddlewareFunc
- type PostUserJSONRequestBody
- type PutUsersUserIdJSONRequestBody
- type RequiredHeaderError
- type RequiredParamError
- type Server
- func (s *Server) DeleteUsersUserId(w http.ResponseWriter, r *http.Request, userId int)
- func (s *Server) GetUsersUserId(w http.ResponseWriter, r *http.Request, userId int)
- func (s *Server) PostUser(w http.ResponseWriter, r *http.Request)
- func (s *Server) PutUsersUserId(w http.ResponseWriter, r *http.Request, userId int)
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) DeleteUsersUserId(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetUsersUserId(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PostUser(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PutUsersUserId(w http.ResponseWriter, r *http.Request)
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type UnmarshallingParamError
- type User
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 InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type PostUserJSONRequestBody ¶
type PostUserJSONRequestBody = User
PostUserJSONRequestBody defines body for PostUser for application/json ContentType.
type PutUsersUserIdJSONRequestBody ¶
type PutUsersUserIdJSONRequestBody = User
PutUsersUserIdJSONRequestBody defines body for PutUsersUserId for application/json ContentType.
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 Server ¶
type Server struct{}
func (*Server) DeleteUsersUserId ¶
func (*Server) GetUsersUserId ¶
func (*Server) PutUsersUserId ¶
type ServerInterface ¶
type ServerInterface interface { // Create New User // (POST /user) PostUser(w http.ResponseWriter, r *http.Request) // (DELETE /users/{userId}) DeleteUsersUserId(w http.ResponseWriter, r *http.Request, userId int) // Get User Info by User ID // (GET /users/{userId}) GetUsersUserId(w http.ResponseWriter, r *http.Request, userId int) // (PUT /users/{userId}) PutUsersUserId(w http.ResponseWriter, r *http.Request, userId int) }
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) DeleteUsersUserId ¶
func (siw *ServerInterfaceWrapper) DeleteUsersUserId(w http.ResponseWriter, r *http.Request)
DeleteUsersUserId operation middleware
func (*ServerInterfaceWrapper) GetUsersUserId ¶
func (siw *ServerInterfaceWrapper) GetUsersUserId(w http.ResponseWriter, r *http.Request)
GetUsersUserId operation middleware
func (*ServerInterfaceWrapper) PostUser ¶
func (siw *ServerInterfaceWrapper) PostUser(w http.ResponseWriter, r *http.Request)
PostUser operation middleware
func (*ServerInterfaceWrapper) PutUsersUserId ¶
func (siw *ServerInterfaceWrapper) PutUsersUserId(w http.ResponseWriter, r *http.Request)
PutUsersUserId 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 UnmarshallingParamError ¶
func (*UnmarshallingParamError) Error ¶
func (e *UnmarshallingParamError) Error() string
func (*UnmarshallingParamError) Unwrap ¶
func (e *UnmarshallingParamError) Unwrap() error
type User ¶
type User struct { // CreateDate The date that the user was created. CreateDate *openapi_types.Date `json:"createDate,omitempty"` DateOfBirth openapi_types.Date `json:"dateOfBirth"` Email openapi_types.Email `json:"email"` FirstName string `json:"firstName"` // Id Unique identifier for the given user. Id *int `json:"id,omitempty"` LastName string `json:"lastName"` }
User defines model for User.
func CreateDummyUser ¶
func CreateDummyUser() *User