gen

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

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

Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.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 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 CreateRoom

type CreateRoom struct {
	RoomId openapi_types.UUID `json:"room_id"`
}

CreateRoom defines model for CreateRoom.

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 ErrorResponse

type ErrorResponse struct {
	// Detail Информация об ошибке
	Detail string `json:"detail"`
}

ErrorResponse Ответ с информацией об ошибке

type GetInfo

type GetInfo struct {
	Version string `json:"version"`
}

GetInfo defines model for GetInfo.

type ServerInterface

type ServerInterface interface {

	// (GET /api/v1/info)
	GetInfo(ctx echo.Context) error

	// (POST /api/v1/rooms)
	CreateRoom(ctx echo.Context) error

	// (DELETE /api/v1/rooms/{id})
	DeleteRoom(ctx echo.Context, id openapi_types.UUID) error

	// (GET /api/v1/ws/{id})
	ConnectRoomWS(ctx echo.Context, id openapi_types.UUID) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) ConnectRoomWS

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

ConnectRoomWS converts echo context to params.

func (*ServerInterfaceWrapper) CreateRoom

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

CreateRoom converts echo context to params.

func (*ServerInterfaceWrapper) DeleteRoom

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

DeleteRoom converts echo context to params.

func (*ServerInterfaceWrapper) GetInfo

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

GetInfo converts echo context to params.

Jump to

Keyboard shortcuts

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