Documentation
¶
Overview ¶
Package openapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.
Index ¶
- func RegisterHandlers(router fiber.Router, si ServerInterface)
- func RegisterHandlersWithOptions(router fiber.Router, si ServerInterface, options FiberServerOptions)
- type Error
- type ErrorResponse
- type FiberServerOptions
- type FieldError
- type GitHubOAuthJSONRequestBody
- type GitHubOAuthRequest
- type GoogleOAuthJSONRequestBody
- type GoogleOAuthRequest
- type HandlerMiddlewareFunc
- type MiddlewareFunc
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) DeleteAccount(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) GitHubOAuth(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) GoogleOAuth(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) Logout(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) RefreshToken(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) ResendVerificationEmail(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) SignIn(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) SignUp(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) Unsubscribe(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) UnsubscribeConfirm(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) UpdateProfile(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) VerifyEmail(c fiber.Ctx) error
- type SignInJSONRequestBody
- type SignInReq
- type SignUpJSONRequestBody
- type SignUpReq
- type Token
- type TokenResp
- type UnsubscribeConfirmForm
- type UnsubscribeConfirmFormdataRequestBody
- type UnsubscribeParams
- type UpdateProfileJSONRequestBody
- type UpdateProfileReq
- type VerifyEmailJSONRequestBody
- type VerifyEmailReq
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterHandlers ¶
func RegisterHandlers(router fiber.Router, si ServerInterface)
RegisterHandlers creates http.Handler with routing matching OpenAPI spec.
func RegisterHandlersWithOptions ¶
func RegisterHandlersWithOptions(router fiber.Router, si ServerInterface, options FiberServerOptions)
RegisterHandlersWithOptions creates http.Handler with additional options
Types ¶
type ErrorResponse ¶
ErrorResponse defines model for ErrorResponse.
type FiberServerOptions ¶
type FiberServerOptions struct {
BaseURL string
Middlewares []MiddlewareFunc
HandlerMiddlewares []HandlerMiddlewareFunc
}
FiberServerOptions provides options for the Fiber server.
type GitHubOAuthJSONRequestBody ¶
type GitHubOAuthJSONRequestBody = GitHubOAuthRequest
GitHubOAuthJSONRequestBody defines body for GitHubOAuth for application/json ContentType.
type GitHubOAuthRequest ¶
type GitHubOAuthRequest struct {
// Code GitHub OAuth authorization code
Code string `json:"code" validate:"required"`
}
GitHubOAuthRequest defines model for GitHubOAuthRequest.
type GoogleOAuthJSONRequestBody ¶
type GoogleOAuthJSONRequestBody = GoogleOAuthRequest
GoogleOAuthJSONRequestBody defines body for GoogleOAuth for application/json ContentType.
type GoogleOAuthRequest ¶
type GoogleOAuthRequest struct {
// IDToken Google ID token
IDToken string `json:"idToken" validate:"required"`
}
GoogleOAuthRequest defines model for GoogleOAuthRequest.
type MiddlewareFunc ¶
type ServerInterface ¶
type ServerInterface interface {
// DeleteAccount Delete account
// (DELETE /account)
DeleteAccount(c fiber.Ctx) error
// UpdateProfile Update profile
// (PATCH /account)
UpdateProfile(c fiber.Ctx) error
// Logout Logout
// (POST /logout)
Logout(c fiber.Ctx) error
// GitHubOAuth GitHub OAuth sign in
// (POST /oauth/github)
GitHubOAuth(c fiber.Ctx) error
// GoogleOAuth Google OAuth sign in
// (POST /oauth/google)
GoogleOAuth(c fiber.Ctx) error
// RefreshToken Refresh tokens
// (POST /refresh)
RefreshToken(c fiber.Ctx) error
// ResendVerificationEmail Resend verification email
// (POST /resend-verification)
ResendVerificationEmail(c fiber.Ctx) error
// SignIn Sign in
// (POST /signin)
SignIn(c fiber.Ctx) error
// SignUp Sign up
// (POST /signup)
SignUp(c fiber.Ctx) error
// Unsubscribe Unsubscribe page
// (GET /unsubscribe)
Unsubscribe(c fiber.Ctx, params UnsubscribeParams) error
// UnsubscribeConfirm Confirm unsubscribe
// (POST /unsubscribe)
UnsubscribeConfirm(c fiber.Ctx) error
// VerifyEmail Verify email
// (POST /verify-email)
VerifyEmail(c fiber.Ctx) error
}
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
HandlerMiddlewares []HandlerMiddlewareFunc
}
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) DeleteAccount ¶
func (siw *ServerInterfaceWrapper) DeleteAccount(c fiber.Ctx) error
DeleteAccount operation middleware
func (*ServerInterfaceWrapper) GitHubOAuth ¶
func (siw *ServerInterfaceWrapper) GitHubOAuth(c fiber.Ctx) error
GitHubOAuth operation middleware
func (*ServerInterfaceWrapper) GoogleOAuth ¶
func (siw *ServerInterfaceWrapper) GoogleOAuth(c fiber.Ctx) error
GoogleOAuth operation middleware
func (*ServerInterfaceWrapper) Logout ¶
func (siw *ServerInterfaceWrapper) Logout(c fiber.Ctx) error
Logout operation middleware
func (*ServerInterfaceWrapper) RefreshToken ¶
func (siw *ServerInterfaceWrapper) RefreshToken(c fiber.Ctx) error
RefreshToken operation middleware
func (*ServerInterfaceWrapper) ResendVerificationEmail ¶
func (siw *ServerInterfaceWrapper) ResendVerificationEmail(c fiber.Ctx) error
ResendVerificationEmail operation middleware
func (*ServerInterfaceWrapper) SignIn ¶
func (siw *ServerInterfaceWrapper) SignIn(c fiber.Ctx) error
SignIn operation middleware
func (*ServerInterfaceWrapper) SignUp ¶
func (siw *ServerInterfaceWrapper) SignUp(c fiber.Ctx) error
SignUp operation middleware
func (*ServerInterfaceWrapper) Unsubscribe ¶
func (siw *ServerInterfaceWrapper) Unsubscribe(c fiber.Ctx) error
Unsubscribe operation middleware
func (*ServerInterfaceWrapper) UnsubscribeConfirm ¶
func (siw *ServerInterfaceWrapper) UnsubscribeConfirm(c fiber.Ctx) error
UnsubscribeConfirm operation middleware
func (*ServerInterfaceWrapper) UpdateProfile ¶
func (siw *ServerInterfaceWrapper) UpdateProfile(c fiber.Ctx) error
UpdateProfile operation middleware
func (*ServerInterfaceWrapper) VerifyEmail ¶
func (siw *ServerInterfaceWrapper) VerifyEmail(c fiber.Ctx) error
VerifyEmail operation middleware
type SignInJSONRequestBody ¶
type SignInJSONRequestBody = SignInReq
SignInJSONRequestBody defines body for SignIn for application/json ContentType.
type SignInReq ¶
type SignInReq struct {
Password string `json:"password" validate:"required,min=8,max=64"`
Username string `json:"username" validate:"required,min=4,max=64"`
}
SignInReq defines model for SignInReq.
type SignUpJSONRequestBody ¶
type SignUpJSONRequestBody = SignUpReq
SignUpJSONRequestBody defines body for SignUp for application/json ContentType.
type SignUpReq ¶
type SignUpReq struct {
// ConfirmPassword must be equal to password
ConfirmPassword string `json:"confirmPassword" validate:"eqfield=Password"`
// Email required for publishers
Email string `json:"email,omitempty" validate:"omitempty,email"`
IsPublisher bool `json:"isPublisher,omitempty"`
// DisplayName display name
DisplayName string `json:"name" validate:"required"`
Password string `json:"password" validate:"required,min=8,max=64"`
Username string `json:"username" validate:"required,min=4,usernameregex"`
}
SignUpReq defines model for SignUpReq.
type TokenResp ¶
type TokenResp struct {
// AccessToken JWT access token
AccessToken string `json:"accessToken"`
}
TokenResp defines model for TokenResp.
type UnsubscribeConfirmForm ¶
type UnsubscribeConfirmForm struct {
// Token unsubscribe token
Token string `json:"token"`
}
UnsubscribeConfirmForm defines model for UnsubscribeConfirmForm.
type UnsubscribeConfirmFormdataRequestBody ¶
type UnsubscribeConfirmFormdataRequestBody = UnsubscribeConfirmForm
UnsubscribeConfirmFormdataRequestBody defines body for UnsubscribeConfirm for application/x-www-form-urlencoded ContentType.
type UnsubscribeParams ¶
type UnsubscribeParams struct {
// Token unsubscribe token from email link
Token string `form:"token,omitempty" json:"token,omitempty"`
}
UnsubscribeParams defines parameters for Unsubscribe.
type UpdateProfileJSONRequestBody ¶
type UpdateProfileJSONRequestBody = UpdateProfileReq
UpdateProfileJSONRequestBody defines body for UpdateProfile for application/json ContentType.
type UpdateProfileReq ¶
type UpdateProfileReq struct {
// ConfirmNewPassword must be equal to newPassword
ConfirmNewPassword *string `json:"confirmNewPassword,omitempty" validate:"omitempty,min=8,max=64"`
Name *string `json:"name,omitempty"`
NewPassword *string `json:"newPassword,omitempty" validate:"omitempty,min=8,max=64"`
// Password current password
Password *string `json:"password,omitempty" validate:"omitempty,min=8,max=64"`
}
UpdateProfileReq password and newPassword must be provided together
type VerifyEmailJSONRequestBody ¶
type VerifyEmailJSONRequestBody = VerifyEmailReq
VerifyEmailJSONRequestBody defines body for VerifyEmail for application/json ContentType.
type VerifyEmailReq ¶
type VerifyEmailReq struct {
// Code 6-digit verification code
Code string `json:"code" validate:"required,len=6"`
}
VerifyEmailReq defines model for VerifyEmailReq.