api

package
v1.1000.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

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

Code generated by github.com/deepmap/oapi-codegen version (devel) DO NOT EDIT.

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

Code generated by github.com/deepmap/oapi-codegen version (devel) 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 BadrequestResponse

type BadrequestResponse struct {
}

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 Example

type Example struct {
	Value *string `json:"value,omitempty"`
}

Example defines model for example.

type HeadersExample200JSONResponse

type HeadersExample200JSONResponse struct {
	Body    Example
	Headers HeadersExample200ResponseHeaders
}

func (HeadersExample200JSONResponse) VisitHeadersExampleResponse

func (response HeadersExample200JSONResponse) VisitHeadersExampleResponse(w http.ResponseWriter) error

type HeadersExample200ResponseHeaders

type HeadersExample200ResponseHeaders struct {
	Header1 string
	Header2 int
}

type HeadersExample400Response

type HeadersExample400Response = BadrequestResponse

func (HeadersExample400Response) VisitHeadersExampleResponse

func (response HeadersExample400Response) VisitHeadersExampleResponse(w http.ResponseWriter) error

type HeadersExampleJSONRequestBody

type HeadersExampleJSONRequestBody = Example

HeadersExampleJSONRequestBody defines body for HeadersExample for application/json ContentType.

type HeadersExampleParams

type HeadersExampleParams struct {
	Header1 string `json:"header1"`
	Header2 *int   `json:"header2,omitempty"`
}

HeadersExampleParams defines parameters for HeadersExample.

type HeadersExampleRequestObject

type HeadersExampleRequestObject struct {
	Params HeadersExampleParams
	Body   *HeadersExampleJSONRequestBody
}

type HeadersExampleResponseObject

type HeadersExampleResponseObject interface {
	VisitHeadersExampleResponse(w http.ResponseWriter) error
}

type HeadersExampledefaultResponse

type HeadersExampledefaultResponse struct {
	StatusCode int
}

func (HeadersExampledefaultResponse) VisitHeadersExampleResponse

func (response HeadersExampledefaultResponse) VisitHeadersExampleResponse(w http.ResponseWriter) error

type JSONExample200JSONResponse

type JSONExample200JSONResponse Example

func (JSONExample200JSONResponse) VisitJSONExampleResponse

func (response JSONExample200JSONResponse) VisitJSONExampleResponse(w http.ResponseWriter) error

type JSONExample400Response

type JSONExample400Response = BadrequestResponse

func (JSONExample400Response) VisitJSONExampleResponse

func (response JSONExample400Response) VisitJSONExampleResponse(w http.ResponseWriter) error

type JSONExampleJSONRequestBody

type JSONExampleJSONRequestBody = Example

JSONExampleJSONRequestBody defines body for JSONExample for application/json ContentType.

type JSONExampleRequestObject

type JSONExampleRequestObject struct {
	Body *JSONExampleJSONRequestBody
}

type JSONExampleResponseObject

type JSONExampleResponseObject interface {
	VisitJSONExampleResponse(w http.ResponseWriter) error
}

type JSONExampledefaultResponse

type JSONExampledefaultResponse struct {
	StatusCode int
}

func (JSONExampledefaultResponse) VisitJSONExampleResponse

func (response JSONExampledefaultResponse) VisitJSONExampleResponse(w http.ResponseWriter) error

type MultipartExample200MultipartResponse

type MultipartExample200MultipartResponse func(writer *multipart.Writer) error

func (MultipartExample200MultipartResponse) VisitMultipartExampleResponse

func (response MultipartExample200MultipartResponse) VisitMultipartExampleResponse(w http.ResponseWriter) error

type MultipartExample400Response

type MultipartExample400Response = BadrequestResponse

func (MultipartExample400Response) VisitMultipartExampleResponse

func (response MultipartExample400Response) VisitMultipartExampleResponse(w http.ResponseWriter) error

type MultipartExampleMultipartRequestBody

type MultipartExampleMultipartRequestBody = Example

MultipartExampleMultipartRequestBody defines body for MultipartExample for multipart/form-data ContentType.

type MultipartExampleRequestObject

type MultipartExampleRequestObject struct {
	Body *multipart.Reader
}

type MultipartExampleResponseObject

type MultipartExampleResponseObject interface {
	VisitMultipartExampleResponse(w http.ResponseWriter) error
}

type MultipartExampledefaultResponse

type MultipartExampledefaultResponse struct {
	StatusCode int
}

func (MultipartExampledefaultResponse) VisitMultipartExampleResponse

func (response MultipartExampledefaultResponse) VisitMultipartExampleResponse(w http.ResponseWriter) error

type MultipleRequestAndResponseTypes200FormdataResponse

type MultipleRequestAndResponseTypes200FormdataResponse Example

func (MultipleRequestAndResponseTypes200FormdataResponse) VisitMultipleRequestAndResponseTypesResponse

func (response MultipleRequestAndResponseTypes200FormdataResponse) VisitMultipleRequestAndResponseTypesResponse(w http.ResponseWriter) error

type MultipleRequestAndResponseTypes200ImagepngResponse

type MultipleRequestAndResponseTypes200ImagepngResponse struct {
	Body          io.Reader
	ContentLength int64
}

func (MultipleRequestAndResponseTypes200ImagepngResponse) VisitMultipleRequestAndResponseTypesResponse

func (response MultipleRequestAndResponseTypes200ImagepngResponse) VisitMultipleRequestAndResponseTypesResponse(w http.ResponseWriter) error

type MultipleRequestAndResponseTypes200JSONResponse

type MultipleRequestAndResponseTypes200JSONResponse Example

func (MultipleRequestAndResponseTypes200JSONResponse) VisitMultipleRequestAndResponseTypesResponse

func (response MultipleRequestAndResponseTypes200JSONResponse) VisitMultipleRequestAndResponseTypesResponse(w http.ResponseWriter) error

type MultipleRequestAndResponseTypes200MultipartResponse

type MultipleRequestAndResponseTypes200MultipartResponse func(writer *multipart.Writer) error

func (MultipleRequestAndResponseTypes200MultipartResponse) VisitMultipleRequestAndResponseTypesResponse

func (response MultipleRequestAndResponseTypes200MultipartResponse) VisitMultipleRequestAndResponseTypesResponse(w http.ResponseWriter) error

type MultipleRequestAndResponseTypes200TextResponse

type MultipleRequestAndResponseTypes200TextResponse string

func (MultipleRequestAndResponseTypes200TextResponse) VisitMultipleRequestAndResponseTypesResponse

func (response MultipleRequestAndResponseTypes200TextResponse) VisitMultipleRequestAndResponseTypesResponse(w http.ResponseWriter) error

type MultipleRequestAndResponseTypes400Response

type MultipleRequestAndResponseTypes400Response = BadrequestResponse

func (MultipleRequestAndResponseTypes400Response) VisitMultipleRequestAndResponseTypesResponse

func (response MultipleRequestAndResponseTypes400Response) VisitMultipleRequestAndResponseTypesResponse(w http.ResponseWriter) error

type MultipleRequestAndResponseTypesFormdataRequestBody

type MultipleRequestAndResponseTypesFormdataRequestBody = Example

MultipleRequestAndResponseTypesFormdataRequestBody defines body for MultipleRequestAndResponseTypes for application/x-www-form-urlencoded ContentType.

type MultipleRequestAndResponseTypesJSONRequestBody

type MultipleRequestAndResponseTypesJSONRequestBody = Example

MultipleRequestAndResponseTypesJSONRequestBody defines body for MultipleRequestAndResponseTypes for application/json ContentType.

type MultipleRequestAndResponseTypesMultipartRequestBody

type MultipleRequestAndResponseTypesMultipartRequestBody = Example

MultipleRequestAndResponseTypesMultipartRequestBody defines body for MultipleRequestAndResponseTypes for multipart/form-data ContentType.

type MultipleRequestAndResponseTypesResponseObject

type MultipleRequestAndResponseTypesResponseObject interface {
	VisitMultipleRequestAndResponseTypesResponse(w http.ResponseWriter) error
}

type MultipleRequestAndResponseTypesTextBody

type MultipleRequestAndResponseTypesTextBody = string

MultipleRequestAndResponseTypesTextBody defines parameters for MultipleRequestAndResponseTypes.

type MultipleRequestAndResponseTypesTextRequestBody

type MultipleRequestAndResponseTypesTextRequestBody = MultipleRequestAndResponseTypesTextBody

MultipleRequestAndResponseTypesTextRequestBody defines body for MultipleRequestAndResponseTypes for text/plain ContentType.

type ReusableResponses200JSONResponse

type ReusableResponses200JSONResponse struct{ ReusableresponseJSONResponse }

func (ReusableResponses200JSONResponse) VisitReusableResponsesResponse

func (response ReusableResponses200JSONResponse) VisitReusableResponsesResponse(w http.ResponseWriter) error

type ReusableResponses400Response

type ReusableResponses400Response = BadrequestResponse

func (ReusableResponses400Response) VisitReusableResponsesResponse

func (response ReusableResponses400Response) VisitReusableResponsesResponse(w http.ResponseWriter) error

type ReusableResponsesJSONRequestBody

type ReusableResponsesJSONRequestBody = Example

ReusableResponsesJSONRequestBody defines body for ReusableResponses for application/json ContentType.

type ReusableResponsesRequestObject

type ReusableResponsesRequestObject struct {
	Body *ReusableResponsesJSONRequestBody
}

type ReusableResponsesResponseObject

type ReusableResponsesResponseObject interface {
	VisitReusableResponsesResponse(w http.ResponseWriter) error
}

type ReusableResponsesdefaultResponse

type ReusableResponsesdefaultResponse struct {
	StatusCode int
}

func (ReusableResponsesdefaultResponse) VisitReusableResponsesResponse

func (response ReusableResponsesdefaultResponse) VisitReusableResponsesResponse(w http.ResponseWriter) error

type Reusableresponse

type Reusableresponse = Example

Reusableresponse defines model for reusableresponse.

type ReusableresponseJSONResponse

type ReusableresponseJSONResponse struct {
	Body Example

	Headers ReusableresponseResponseHeaders
}

type ReusableresponseResponseHeaders

type ReusableresponseResponseHeaders struct {
	Header1 string
	Header2 int
}

type ServerInterface

type ServerInterface interface {

	// (POST /json)
	JSONExample(ctx echo.Context) error

	// (POST /multipart)
	MultipartExample(ctx echo.Context) error

	// (POST /multiple)
	MultipleRequestAndResponseTypes(ctx echo.Context) error

	// (POST /reusable-responses)
	ReusableResponses(ctx echo.Context) error

	// (POST /text)
	TextExample(ctx echo.Context) error

	// (POST /unknown)
	UnknownExample(ctx echo.Context) error

	// (POST /unspecified-content-type)
	UnspecifiedContentType(ctx echo.Context) error

	// (POST /urlencoded)
	URLEncodedExample(ctx echo.Context) error

	// (POST /with-headers)
	HeadersExample(ctx echo.Context, params HeadersExampleParams) error
}

ServerInterface represents all server handlers.

func NewStrictHandler

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

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) HeadersExample

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

HeadersExample converts echo context to params.

func (*ServerInterfaceWrapper) JSONExample

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

JSONExample converts echo context to params.

func (*ServerInterfaceWrapper) MultipartExample

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

MultipartExample converts echo context to params.

func (*ServerInterfaceWrapper) MultipleRequestAndResponseTypes

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

MultipleRequestAndResponseTypes converts echo context to params.

func (*ServerInterfaceWrapper) ReusableResponses

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

ReusableResponses converts echo context to params.

func (*ServerInterfaceWrapper) TextExample

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

TextExample converts echo context to params.

func (*ServerInterfaceWrapper) URLEncodedExample

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

URLEncodedExample converts echo context to params.

func (*ServerInterfaceWrapper) UnknownExample

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

UnknownExample converts echo context to params.

func (*ServerInterfaceWrapper) UnspecifiedContentType

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

UnspecifiedContentType converts echo context to params.

type StrictHandlerFunc

type StrictHandlerFunc func(ctx echo.Context, args interface{}) (interface{}, error)

type StrictMiddlewareFunc

type StrictMiddlewareFunc func(f StrictHandlerFunc, operationID string) StrictHandlerFunc

type StrictServer

type StrictServer struct {
}

func (StrictServer) HeadersExample

func (StrictServer) JSONExample

func (StrictServer) MultipartExample

func (StrictServer) TextExample

func (StrictServer) UnknownExample

type StrictServerInterface

type StrictServerInterface interface {

	// (POST /json)
	JSONExample(ctx context.Context, request JSONExampleRequestObject) (JSONExampleResponseObject, error)

	// (POST /multipart)
	MultipartExample(ctx context.Context, request MultipartExampleRequestObject) (MultipartExampleResponseObject, error)

	// (POST /multiple)
	MultipleRequestAndResponseTypes(ctx context.Context, request MultipleRequestAndResponseTypesRequestObject) (MultipleRequestAndResponseTypesResponseObject, error)

	// (POST /reusable-responses)
	ReusableResponses(ctx context.Context, request ReusableResponsesRequestObject) (ReusableResponsesResponseObject, error)

	// (POST /text)
	TextExample(ctx context.Context, request TextExampleRequestObject) (TextExampleResponseObject, error)

	// (POST /unknown)
	UnknownExample(ctx context.Context, request UnknownExampleRequestObject) (UnknownExampleResponseObject, error)

	// (POST /unspecified-content-type)
	UnspecifiedContentType(ctx context.Context, request UnspecifiedContentTypeRequestObject) (UnspecifiedContentTypeResponseObject, error)

	// (POST /urlencoded)
	URLEncodedExample(ctx context.Context, request URLEncodedExampleRequestObject) (URLEncodedExampleResponseObject, error)

	// (POST /with-headers)
	HeadersExample(ctx context.Context, request HeadersExampleRequestObject) (HeadersExampleResponseObject, error)
}

StrictServerInterface represents all server handlers.

type TextExample200TextResponse

type TextExample200TextResponse string

func (TextExample200TextResponse) VisitTextExampleResponse

func (response TextExample200TextResponse) VisitTextExampleResponse(w http.ResponseWriter) error

type TextExample400Response

type TextExample400Response = BadrequestResponse

func (TextExample400Response) VisitTextExampleResponse

func (response TextExample400Response) VisitTextExampleResponse(w http.ResponseWriter) error

type TextExampleRequestObject

type TextExampleRequestObject struct {
	Body *TextExampleTextRequestBody
}

type TextExampleResponseObject

type TextExampleResponseObject interface {
	VisitTextExampleResponse(w http.ResponseWriter) error
}

type TextExampleTextBody

type TextExampleTextBody = string

TextExampleTextBody defines parameters for TextExample.

type TextExampleTextRequestBody

type TextExampleTextRequestBody = TextExampleTextBody

TextExampleTextRequestBody defines body for TextExample for text/plain ContentType.

type TextExampledefaultResponse

type TextExampledefaultResponse struct {
	StatusCode int
}

func (TextExampledefaultResponse) VisitTextExampleResponse

func (response TextExampledefaultResponse) VisitTextExampleResponse(w http.ResponseWriter) error

type URLEncodedExample200FormdataResponse

type URLEncodedExample200FormdataResponse Example

func (URLEncodedExample200FormdataResponse) VisitURLEncodedExampleResponse

func (response URLEncodedExample200FormdataResponse) VisitURLEncodedExampleResponse(w http.ResponseWriter) error

type URLEncodedExample400Response

type URLEncodedExample400Response = BadrequestResponse

func (URLEncodedExample400Response) VisitURLEncodedExampleResponse

func (response URLEncodedExample400Response) VisitURLEncodedExampleResponse(w http.ResponseWriter) error

type URLEncodedExampleFormdataRequestBody

type URLEncodedExampleFormdataRequestBody = Example

URLEncodedExampleFormdataRequestBody defines body for URLEncodedExample for application/x-www-form-urlencoded ContentType.

type URLEncodedExampleRequestObject

type URLEncodedExampleRequestObject struct {
	Body *URLEncodedExampleFormdataRequestBody
}

type URLEncodedExampleResponseObject

type URLEncodedExampleResponseObject interface {
	VisitURLEncodedExampleResponse(w http.ResponseWriter) error
}

type URLEncodedExampledefaultResponse

type URLEncodedExampledefaultResponse struct {
	StatusCode int
}

func (URLEncodedExampledefaultResponse) VisitURLEncodedExampleResponse

func (response URLEncodedExampledefaultResponse) VisitURLEncodedExampleResponse(w http.ResponseWriter) error

type UnknownExample200Videomp4Response

type UnknownExample200Videomp4Response struct {
	Body          io.Reader
	ContentLength int64
}

func (UnknownExample200Videomp4Response) VisitUnknownExampleResponse

func (response UnknownExample200Videomp4Response) VisitUnknownExampleResponse(w http.ResponseWriter) error

type UnknownExample400Response

type UnknownExample400Response = BadrequestResponse

func (UnknownExample400Response) VisitUnknownExampleResponse

func (response UnknownExample400Response) VisitUnknownExampleResponse(w http.ResponseWriter) error

type UnknownExampleRequestObject

type UnknownExampleRequestObject struct {
	Body io.Reader
}

type UnknownExampleResponseObject

type UnknownExampleResponseObject interface {
	VisitUnknownExampleResponse(w http.ResponseWriter) error
}

type UnknownExampledefaultResponse

type UnknownExampledefaultResponse struct {
	StatusCode int
}

func (UnknownExampledefaultResponse) VisitUnknownExampleResponse

func (response UnknownExampledefaultResponse) VisitUnknownExampleResponse(w http.ResponseWriter) error

type UnspecifiedContentType200VideoResponse

type UnspecifiedContentType200VideoResponse struct {
	Body          io.Reader
	ContentType   string
	ContentLength int64
}

func (UnspecifiedContentType200VideoResponse) VisitUnspecifiedContentTypeResponse

func (response UnspecifiedContentType200VideoResponse) VisitUnspecifiedContentTypeResponse(w http.ResponseWriter) error

type UnspecifiedContentType400Response

type UnspecifiedContentType400Response = BadrequestResponse

func (UnspecifiedContentType400Response) VisitUnspecifiedContentTypeResponse

func (response UnspecifiedContentType400Response) VisitUnspecifiedContentTypeResponse(w http.ResponseWriter) error

type UnspecifiedContentType401Response

type UnspecifiedContentType401Response struct {
}

func (UnspecifiedContentType401Response) VisitUnspecifiedContentTypeResponse

func (response UnspecifiedContentType401Response) VisitUnspecifiedContentTypeResponse(w http.ResponseWriter) error

type UnspecifiedContentType403Response

type UnspecifiedContentType403Response struct {
}

func (UnspecifiedContentType403Response) VisitUnspecifiedContentTypeResponse

func (response UnspecifiedContentType403Response) VisitUnspecifiedContentTypeResponse(w http.ResponseWriter) error

type UnspecifiedContentTypeRequestObject

type UnspecifiedContentTypeRequestObject struct {
	ContentType string
	Body        io.Reader
}

type UnspecifiedContentTypeResponseObject

type UnspecifiedContentTypeResponseObject interface {
	VisitUnspecifiedContentTypeResponse(w http.ResponseWriter) error
}

type UnspecifiedContentTypedefaultResponse

type UnspecifiedContentTypedefaultResponse struct {
	StatusCode int
}

func (UnspecifiedContentTypedefaultResponse) VisitUnspecifiedContentTypeResponse

func (response UnspecifiedContentTypedefaultResponse) VisitUnspecifiedContentTypeResponse(w http.ResponseWriter) error

Jump to

Keyboard shortcuts

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