openapi

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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 Error

type Error = ErrorResponse

Error defines model for Error.

type ErrorResponse

type ErrorResponse = web.ErrResp

ErrorResponse defines model for ErrorResponse.

type FiberServerOptions

type FiberServerOptions struct {
	BaseURL            string
	Middlewares        []MiddlewareFunc
	HandlerMiddlewares []HandlerMiddlewareFunc
}

FiberServerOptions provides options for the Fiber server.

type FieldError

type FieldError = web.FieldError

FieldError defines model for FieldError.

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 HandlerMiddlewareFunc

type HandlerMiddlewareFunc func(c fiber.Ctx, next fiber.Handler) error

type MiddlewareFunc

type MiddlewareFunc fiber.Handler

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 Token

type Token = TokenResp

Token defines model for Token.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL