controller

package
v0.0.0-...-404d8b9 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package controller 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 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 New

func New() *echo.Echo

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 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 Healthz200JSONResponse

type Healthz200JSONResponse Message

func (Healthz200JSONResponse) VisitHealthzResponse

func (response Healthz200JSONResponse) VisitHealthzResponse(w http.ResponseWriter) error

type HealthzRequestObject

type HealthzRequestObject struct {
}

type HealthzResponseObject

type HealthzResponseObject interface {
	VisitHealthzResponse(w http.ResponseWriter) error
}

type Index200JSONResponse

type Index200JSONResponse Message

func (Index200JSONResponse) VisitIndexResponse

func (response Index200JSONResponse) VisitIndexResponse(w http.ResponseWriter) error

type IndexRequestObject

type IndexRequestObject struct {
}

type IndexResponseObject

type IndexResponseObject interface {
	VisitIndexResponse(w http.ResponseWriter) error
}

type Message

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

Message defines model for Message.

type Server

type Server struct{}

func (*Server) Healthz

func (server *Server) Healthz(ctx context.Context, request HealthzRequestObject) (HealthzResponseObject, error)

(GET /healthz)

func (*Server) Index

func (server *Server) Index(ctx context.Context, request IndexRequestObject) (IndexResponseObject, error)

(GET /)

type ServerInterface

type ServerInterface interface {

	// (GET /)
	Index(ctx echo.Context) error

	// (GET /healthz)
	Healthz(ctx echo.Context) 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) Healthz

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

Healthz converts echo context to params.

func (*ServerInterfaceWrapper) Index

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

Index converts echo context to params.

type StrictHandlerFunc

type StrictHandlerFunc = strictecho.StrictEchoHandlerFunc

type StrictMiddlewareFunc

type StrictMiddlewareFunc = strictecho.StrictEchoMiddlewareFunc

type StrictServerInterface

type StrictServerInterface interface {

	// (GET /)
	Index(ctx context.Context, request IndexRequestObject) (IndexResponseObject, error)

	// (GET /healthz)
	Healthz(ctx context.Context, request HealthzRequestObject) (HealthzResponseObject, error)
}

StrictServerInterface represents all server handlers.

Jump to

Keyboard shortcuts

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