schema

package
v0.0.0-...-394bd34 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2023 License: MIT Imports: 3 Imported by: 0

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

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

type CreateUserResponse struct {
	Email string `json:"email"`
	Id    string `json:"id"`
}

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

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap

func (e *InvalidParamFormatError) Unwrap() error

type LoginRequest

type LoginRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

LoginRequest defines model for LoginRequest.

type LoginToken

type LoginToken struct {
	Access  string `json:"access"`
	Refresh string `json:"refresh"`
}

LoginToken defines model for LoginToken.

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

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

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

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

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type UnescapedCookieParamError

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

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

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

Jump to

Keyboard shortcuts

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