public

package
v0.0.0-...-2671613 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

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

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

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

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

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

Code generated by github.com/deepmap/oapi-codegen version v1.16.3 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 CreateTodoJSONRequestBody

type CreateTodoJSONRequestBody = ToDoInput

CreateTodoJSONRequestBody defines body for CreateTodo 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 PatchTodoJSONRequestBody

type PatchTodoJSONRequestBody = ToDoInputPatch

PatchTodoJSONRequestBody defines body for PatchTodo for application/json ContentType.

type ServerInterface

type ServerInterface interface {
	// Retrieve all ToDo items
	// (GET /todos)
	GetAllTodos(ctx echo.Context) error
	// Create a new ToDo item
	// (POST /todos)
	CreateTodo(ctx echo.Context) error
	// Remove item by ID
	// (DELETE /todos/{todoId})
	DeleteTodo(ctx echo.Context, todoId openapi_types.UUID) error
	// Get item by ID
	// (GET /todos/{todoId})
	GetTodo(ctx echo.Context, todoId openapi_types.UUID) error
	// Patch an existing ToDo item
	// (PATCH /todos/{todoId})
	PatchTodo(ctx echo.Context, todoId openapi_types.UUID) error
	// Substitute an existing ToDo item
	// (PUT /todos/{todoId})
	UpdateTodo(ctx echo.Context, todoId openapi_types.UUID) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) CreateTodo

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

CreateTodo converts echo context to params.

func (*ServerInterfaceWrapper) DeleteTodo

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

DeleteTodo converts echo context to params.

func (*ServerInterfaceWrapper) GetAllTodos

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

GetAllTodos converts echo context to params.

func (*ServerInterfaceWrapper) GetTodo

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

GetTodo converts echo context to params.

func (*ServerInterfaceWrapper) PatchTodo

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

PatchTodo converts echo context to params.

func (*ServerInterfaceWrapper) UpdateTodo

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

UpdateTodo converts echo context to params.

type ToDo

type ToDo struct {
	Description string              `json:"description"`
	DueDate     *time.Time          `json:"due_date,omitempty"`
	Title       string              `json:"title"`
	TodoId      *openapi_types.UUID `json:"todo_id,omitempty"`
}

ToDo defines model for ToDo.

type ToDoInput

type ToDoInput struct {
	Description *string             `json:"description,omitempty"`
	DueDate     *openapi_types.Date `json:"due_date,omitempty"`
	Title       string              `json:"title"`
}

ToDoInput defines model for ToDoInput.

type ToDoInputPatch

type ToDoInputPatch struct {
	Description *string             `json:"description,omitempty"`
	DueDate     *openapi_types.Date `json:"due_date,omitempty"`
	Title       *string             `json:"title,omitempty"`
}

ToDoInputPatch defines model for ToDoInputPatch.

type UpdateTodoJSONRequestBody

type UpdateTodoJSONRequestBody = ToDoInput

UpdateTodoJSONRequestBody defines body for UpdateTodo for application/json ContentType.

Jump to

Keyboard shortcuts

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