api

package
v0.0.0-...-2c2e33e Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

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

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

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

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

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

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.Swagger, 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 Card

type Card struct {
	Suit  string `json:"suit"`
	Value string `json:"value"`
}

Card defines model for Card.

type DeckReturnCard2Params

type DeckReturnCard2Params struct {

	// Short-form or long-form encoding of the card to return to the deck
	Card *string `json:"card,omitempty"`
}

DeckReturnCard2Params defines parameters for DeckReturnCard2.

type DeckReturnCardJSONBody

type DeckReturnCardJSONBody Card

DeckReturnCardJSONBody defines parameters for DeckReturnCard.

type DeckReturnCardJSONRequestBody

type DeckReturnCardJSONRequestBody DeckReturnCardJSONBody

DeckReturnCardJSONRequestBody defines body for DeckReturnCard for application/json ContentType.

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 Error

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

Error defines model for Error.

type ServerInterface

type ServerInterface interface {
	// Get documentation index.html that describes this api
	// (GET /)
	Index(ctx echo.Context) error
	// Get the current state of the deck
	// (GET /cards)
	DeckShow(ctx echo.Context) error
	// Deal the top card by removing it from the deck (in-browser testing helper)
	// (GET /cards/deal)
	DeckDealCard2(ctx echo.Context) error
	// Deal the top card by removing it from the deck
	// (POST /cards/deal)
	DeckDealCard(ctx echo.Context) error
	// Return the card specified in the '?card=' parameter to the back of the deck (in-browser testing helper)
	// (GET /cards/return)
	DeckReturnCard2(ctx echo.Context, params DeckReturnCard2Params) error
	// Return the card specified in the body to the back of the deck
	// (POST /cards/return)
	DeckReturnCard(ctx echo.Context) error
	// Permute the deck in an unbiased way (in-browser testing helper)
	// (GET /cards/shuffle)
	DeckShuffle2(ctx echo.Context) error
	// Permute the deck in an unbiased way
	// (POST /cards/shuffle)
	DeckShuffle(ctx echo.Context) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) DeckDealCard

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

DeckDealCard converts echo context to params.

func (*ServerInterfaceWrapper) DeckDealCard2

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

DeckDealCard2 converts echo context to params.

func (*ServerInterfaceWrapper) DeckReturnCard

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

DeckReturnCard converts echo context to params.

func (*ServerInterfaceWrapper) DeckReturnCard2

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

DeckReturnCard2 converts echo context to params.

func (*ServerInterfaceWrapper) DeckShow

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

DeckShow converts echo context to params.

func (*ServerInterfaceWrapper) DeckShuffle

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

DeckShuffle converts echo context to params.

func (*ServerInterfaceWrapper) DeckShuffle2

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

DeckShuffle2 converts echo context to params.

func (*ServerInterfaceWrapper) Index

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

Index converts echo context to params.

Jump to

Keyboard shortcuts

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