Documentation ¶
Overview ¶
Package schema provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.15.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 CreateUserRequest
- type CreateUserResponse
- type ErrorResponse
- type ErrorResponseCode
- type InvalidParamFormatError
- type LoginRequest
- type LoginToken
- type MiddlewareFunc
- type PostAuthLoginJSONRequestBody
- type PostAuthRefreshJSONRequestBody
- type PostUsersJSONRequestBody
- type RefreshTokenRequest
- type RequiredHeaderError
- type RequiredParamError
- type ServerInterface
- type ServerInterfaceWrapper
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type Unimplemented
- type UnmarshalingParamError
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 CreateUserRequest ¶
type CreateUserRequest struct { Email string `json:"email"` // Password the password must be between 8 and 30 chars and it must contain at least 1 lower case, // 1 upper case, 1 special char and 1 number Password string `json:"password"` }
CreateUserRequest defines model for CreateUserRequest.
type CreateUserResponse ¶
CreateUserResponse defines model for CreateUserResponse.
type ErrorResponse ¶
type ErrorResponse struct { Code ErrorResponseCode `json:"code"` Msg string `json:"msg"` }
ErrorResponse defines model for ErrorResponse.
type ErrorResponseCode ¶
type ErrorResponseCode int
ErrorResponseCode defines model for ErrorResponse.Code.
const ( N400 ErrorResponseCode = 400 N401 ErrorResponseCode = 401 N409 ErrorResponseCode = 409 N500 ErrorResponseCode = 500 )
Defines values for ErrorResponseCode.
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type LoginRequest ¶
LoginRequest defines model for LoginRequest.
type LoginToken ¶
LoginToken defines model for LoginToken.
type PostAuthLoginJSONRequestBody ¶
type PostAuthLoginJSONRequestBody = LoginRequest
PostAuthLoginJSONRequestBody defines body for PostAuthLogin for application/json ContentType.
type PostAuthRefreshJSONRequestBody ¶
type PostAuthRefreshJSONRequestBody = RefreshTokenRequest
PostAuthRefreshJSONRequestBody defines body for PostAuthRefresh for application/json ContentType.
type PostUsersJSONRequestBody ¶
type PostUsersJSONRequestBody = CreateUserRequest
PostUsersJSONRequestBody defines body for PostUsers for application/json ContentType.
type RefreshTokenRequest ¶
type RefreshTokenRequest struct {
Refresh string `json:"refresh"`
}
RefreshTokenRequest defines model for RefreshTokenRequest.
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 { // perform user login // (POST /auth/login) PostAuthLogin(w http.ResponseWriter, r *http.Request) // refresh an token // (POST /auth/refresh) PostAuthRefresh(w http.ResponseWriter, r *http.Request) // create a User // (POST /users) PostUsers(w http.ResponseWriter, r *http.Request) }
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) PostAuthLogin ¶
func (siw *ServerInterfaceWrapper) PostAuthLogin(w http.ResponseWriter, r *http.Request)
PostAuthLogin operation middleware
func (*ServerInterfaceWrapper) PostAuthRefresh ¶
func (siw *ServerInterfaceWrapper) PostAuthRefresh(w http.ResponseWriter, r *http.Request)
PostAuthRefresh operation middleware
func (*ServerInterfaceWrapper) PostUsers ¶
func (siw *ServerInterfaceWrapper) PostUsers(w http.ResponseWriter, r *http.Request)
PostUsers 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 Unimplemented ¶
type Unimplemented struct{}
func (Unimplemented) PostAuthLogin ¶
func (_ Unimplemented) PostAuthLogin(w http.ResponseWriter, r *http.Request)
perform user login (POST /auth/login)
func (Unimplemented) PostAuthRefresh ¶
func (_ Unimplemented) PostAuthRefresh(w http.ResponseWriter, r *http.Request)
refresh an token (POST /auth/refresh)
func (Unimplemented) PostUsers ¶
func (_ Unimplemented) PostUsers(w http.ResponseWriter, r *http.Request)
create a User (POST /users)
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error