Documentation ¶
Overview ¶
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.11.1-0.20220629212257-2cf7fcf5b26d DO NOT EDIT.
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.11.1-0.20220629212257-2cf7fcf5b26d DO NOT EDIT.
Index ¶
- Constants
- 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 InvalidParamFormatError
- type LoginJSONBody
- type LoginJSONRequestBody
- type LoginRequest
- type LoginResponse
- type MiddlewareFunc
- type ProblemDetails
- type RequiredHeaderError
- type RequiredParamError
- type Secret2FAResponse
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) Login(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) Setup2FA(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) Signup(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) TestAuth(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) Verify2FA(w http.ResponseWriter, r *http.Request)
- type SignupJSONBody
- type SignupJSONRequestBody
- type SignupRequest
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type UnmarshalingParamError
- type Verify2FAJSONBody
- type Verify2FAJSONRequestBody
- type Verify2FARequest
- type VerifyResponse
Constants ¶
const ( AuthBearerTokenScopes = "authBearerToken.Scopes" UnauthBearerTokenScopes = "unauthBearerToken.Scopes" )
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 InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type LoginJSONBody ¶
type LoginJSONBody struct { // Password of an user account Password string `json:"password" validate:"required"` // Username of an user account Username string `json:"username" validate:"required"` }
LoginJSONBody defines parameters for Login.
type LoginJSONRequestBody ¶
type LoginJSONRequestBody LoginJSONBody
LoginJSONRequestBody defines body for Login for application/json ContentType.
type LoginRequest ¶
type LoginRequest struct { // Password of an user account Password string `json:"password" validate:"required"` // Username of an user account Username string `json:"username" validate:"required"` }
LoginRequest defines model for LoginRequest.
type LoginResponse ¶
type LoginResponse struct { // An unauthenticated JWT access token needed in 2FA. UnauthToken string `json:"unauth_token"` }
LoginResponse defines model for LoginResponse.
type ProblemDetails ¶
type ProblemDetails struct { // Human-readable explanation specific to this occurrence of the problem Detail string `json:"detail"` // A URI reference that identifies the specific occurrence of the problem Instance string `json:"instance"` // A http status code describing a problem StatusCode int `json:"status_code"` // A short, human-readable summary of the problem type Title string `json:"title"` }
A problem details response, which occured during processing of a request. (Trying to adhere to RFC 7807)
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 Secret2FAResponse ¶
type Secret2FAResponse struct {
QrURI *string `json:"qrURI,omitempty"`
}
Secret2FAResponse defines model for Secret2FAResponse.
type ServerInterface ¶
type ServerInterface interface { // (POST /2fa/setup) Setup2FA(w http.ResponseWriter, r *http.Request) // (POST /2fa/verify) Verify2FA(w http.ResponseWriter, r *http.Request) // (POST /login) Login(w http.ResponseWriter, r *http.Request) // (POST /signup) Signup(w http.ResponseWriter, r *http.Request) // (GET /test-auth) TestAuth(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) Login ¶
func (siw *ServerInterfaceWrapper) Login(w http.ResponseWriter, r *http.Request)
Login operation middleware
func (*ServerInterfaceWrapper) Setup2FA ¶
func (siw *ServerInterfaceWrapper) Setup2FA(w http.ResponseWriter, r *http.Request)
Setup2FA operation middleware
func (*ServerInterfaceWrapper) Signup ¶
func (siw *ServerInterfaceWrapper) Signup(w http.ResponseWriter, r *http.Request)
Signup operation middleware
func (*ServerInterfaceWrapper) TestAuth ¶
func (siw *ServerInterfaceWrapper) TestAuth(w http.ResponseWriter, r *http.Request)
TestAuth operation middleware
func (*ServerInterfaceWrapper) Verify2FA ¶
func (siw *ServerInterfaceWrapper) Verify2FA(w http.ResponseWriter, r *http.Request)
Verify2FA operation middleware
type SignupJSONBody ¶
type SignupJSONBody struct { // Email address of a new user account Email string `json:"email" validate:"required"` // Password for getting access to the new user account Password string `json:"password" validate:"required"` // Username with which new user account will be identified in the system Username string `json:"username" validate:"required"` }
SignupJSONBody defines parameters for Signup.
type SignupJSONRequestBody ¶
type SignupJSONRequestBody SignupJSONBody
SignupJSONRequestBody defines body for Signup for application/json ContentType.
type SignupRequest ¶
type SignupRequest struct { // Email address of a new user account Email string `json:"email" validate:"required"` // Password for getting access to the new user account Password string `json:"password" validate:"required"` // Username with which new user account will be identified in the system Username string `json:"username" validate:"required"` }
SignupRequest defines model for SignupRequest.
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 UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error
type Verify2FAJSONBody ¶
type Verify2FAJSONBody struct { // OTP for 2FA Otp int `json:"otp" validate:"required"` }
Verify2FAJSONBody defines parameters for Verify2FA.
type Verify2FAJSONRequestBody ¶
type Verify2FAJSONRequestBody Verify2FAJSONBody
Verify2FAJSONRequestBody defines body for Verify2FA for application/json ContentType.
type Verify2FARequest ¶
type Verify2FARequest struct { // OTP for 2FA Otp int `json:"otp" validate:"required"` }
Verify2FARequest defines model for Verify2FARequest.
type VerifyResponse ¶
type VerifyResponse struct { // An full access JWT. AccessToken string `json:"access_token"` }
VerifyResponse defines model for VerifyResponse.