converterapi

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

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

Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

func RegisterHandlers

func RegisterHandlers(router EchoRouter, si ServerInterface)

RegisterHandlers adds each server route to the EchoRouter.

func RegisterHandlersWithBaseURL

func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)

Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.

Types

type Api

type Api struct {
}

func (*Api) ConvertNumberToWord

func (a *Api) ConvertNumberToWord(ctx echo.Context, params ConvertNumberToWordParams) error

func (*Api) ConvertWordsToNumber

func (a *Api) ConvertWordsToNumber(ctx echo.Context, params ConvertWordsToNumberParams) error

type EchoRouter

type EchoRouter interface {
	CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}

This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration

type ServerInterface

type ServerInterface interface {
	// Convert words in Azerbaijani to number
	// (POST /api/v1/conversion/to-number)
	ConvertWordsToNumber(ctx echo.Context, params ConvertWordsToNumberParams) error
	// Convert number to words in Azerbaijani
	// (POST /api/v1/conversion/to-word)
	ConvertNumberToWord(ctx echo.Context, params ConvertNumberToWordParams) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) ConvertNumberToWord

func (w *ServerInterfaceWrapper) ConvertNumberToWord(ctx echo.Context) error

ConvertNumberToWord converts echo context to params.

func (*ServerInterfaceWrapper) ConvertWordsToNumber

func (w *ServerInterfaceWrapper) ConvertWordsToNumber(ctx echo.Context) error

ConvertWordsToNumber converts echo context to params.

Jump to

Keyboard shortcuts

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