oapigen

package
v0.0.0-...-907d1b5 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package oapigen provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.13.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 EmojiDefinition

type EmojiDefinition struct {
	Alias string `json:"alias"`
	Char  string `json:"char"`
}

EmojiDefinition defines model for EmojiDefinition.

type Error

type Error struct {
	Message string `json:"message"`
}

Error default error

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 MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

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 {

	// (POST /emoji/suggest)
	Suggest(w http.ResponseWriter, r *http.Request)

	// (POST /emoji/translate)
	Translate(w http.ResponseWriter, r *http.Request)
}

ServerInterface represents all server handlers.

func NewStrictHandler

func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface

func NewStrictHandlerWithOptions

func NewStrictHandlerWithOptions(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc, options StrictHTTPServerOptions) ServerInterface

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) Suggest

Suggest operation middleware

func (*ServerInterfaceWrapper) Translate

func (siw *ServerInterfaceWrapper) Translate(w http.ResponseWriter, r *http.Request)

Translate operation middleware

type StrictHTTPServerOptions

type StrictHTTPServerOptions struct {
	RequestErrorHandlerFunc  func(w http.ResponseWriter, r *http.Request, err error)
	ResponseErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type StrictHandlerFunc

type StrictHandlerFunc = runtime.StrictHttpHandlerFunc

type StrictMiddlewareFunc

type StrictMiddlewareFunc = runtime.StrictHttpMiddlewareFunc

type StrictServerInterface

type StrictServerInterface interface {

	// (POST /emoji/suggest)
	Suggest(ctx context.Context, request SuggestRequestObject) (SuggestResponseObject, error)

	// (POST /emoji/translate)
	Translate(ctx context.Context, request TranslateRequestObject) (TranslateResponseObject, error)
}

StrictServerInterface represents all server handlers.

type Suggest200JSONResponse

type Suggest200JSONResponse []EmojiDefinition

func (Suggest200JSONResponse) VisitSuggestResponse

func (response Suggest200JSONResponse) VisitSuggestResponse(w http.ResponseWriter) error

type SuggestJSONBody

type SuggestJSONBody struct {
	Limit  *int                `json:"limit,omitempty"`
	Prefix string              `json:"prefix"`
	Sort   SuggestJSONBodySort `json:"sort"`
}

SuggestJSONBody defines parameters for Suggest.

type SuggestJSONBodySort

type SuggestJSONBodySort string

SuggestJSONBodySort defines parameters for Suggest.

const (
	SuggestJSONBodySortAsc  SuggestJSONBodySort = "asc"
	SuggestJSONBodySortDesc SuggestJSONBodySort = "desc"
)

Defines values for SuggestJSONBodySort.

type SuggestJSONRequestBody

type SuggestJSONRequestBody SuggestJSONBody

SuggestJSONRequestBody defines body for Suggest for application/json ContentType.

type SuggestRequestObject

type SuggestRequestObject struct {
	Body *SuggestJSONRequestBody
}

type SuggestResponseObject

type SuggestResponseObject interface {
	VisitSuggestResponse(w http.ResponseWriter) error
}

type SuggestdefaultJSONResponse

type SuggestdefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (SuggestdefaultJSONResponse) VisitSuggestResponse

func (response SuggestdefaultJSONResponse) VisitSuggestResponse(w http.ResponseWriter) error

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type Translate200JSONResponse

type Translate200JSONResponse string

func (Translate200JSONResponse) VisitTranslateResponse

func (response Translate200JSONResponse) VisitTranslateResponse(w http.ResponseWriter) error

type TranslateJSONBody

type TranslateJSONBody struct {
	Text string `json:"text"`
}

TranslateJSONBody defines parameters for Translate.

type TranslateJSONRequestBody

type TranslateJSONRequestBody TranslateJSONBody

TranslateJSONRequestBody defines body for Translate for application/json ContentType.

type TranslateRequestObject

type TranslateRequestObject struct {
	Body *TranslateJSONRequestBody
}

type TranslateResponseObject

type TranslateResponseObject interface {
	VisitTranslateResponse(w http.ResponseWriter) error
}

type TranslatedefaultJSONResponse

type TranslatedefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (TranslatedefaultJSONResponse) VisitTranslateResponse

func (response TranslatedefaultJSONResponse) VisitTranslateResponse(w http.ResponseWriter) 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 UnmarshallingParamError

type UnmarshallingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshallingParamError) Error

func (e *UnmarshallingParamError) Error() string

func (*UnmarshallingParamError) Unwrap

func (e *UnmarshallingParamError) Unwrap() error

Jump to

Keyboard shortcuts

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