Documentation
¶
Overview ¶
Package gen provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.
Index ¶
- func RegisterHandlers(router EchoRouter, si ServerInterface)
- func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
- type EchoRouter
- type PostTaskJSONBody
- type PostTaskJSONBodyBodyType
- type PostTaskJSONRequestBody
- type ServerInterface
- type ServerInterfaceWrapper
- func (w *ServerInterfaceWrapper) DeleteTaskID(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetTask(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetTaskID(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetTaskStatus(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) PostTask(ctx echo.Context) error
- type TaskErrorResponse
- type TaskItemIdResponse
- type TaskItemResponse
- type TaskResponse
- type TaskStatusResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 PostTaskJSONBody ¶
type PostTaskJSONBody struct {
// Body JSON representation of the task item.
Body struct {
// Data The action-specific data.
Data map[string]interface{} `json:"data"`
// Type The type of task action to perform.
Type PostTaskJSONBodyBodyType `json:"type"`
} `json:"body"`
}
PostTaskJSONBody defines parameters for PostTask.
type PostTaskJSONBodyBodyType ¶
type PostTaskJSONBodyBodyType string
PostTaskJSONBodyBodyType defines parameters for PostTask.
const ( Dns PostTaskJSONBodyBodyType = "dns" Shutdown PostTaskJSONBodyBodyType = "shutdown" )
Defines values for PostTaskJSONBodyBodyType.
type PostTaskJSONRequestBody ¶
type PostTaskJSONRequestBody PostTaskJSONBody
PostTaskJSONRequestBody defines body for PostTask for application/json ContentType.
type ServerInterface ¶
type ServerInterface interface {
// List all task items
// (GET /task)
GetTask(ctx echo.Context) error
// Add an task item
// (POST /task)
PostTask(ctx echo.Context) error
// Returns the total number of task items
// (GET /task/status)
GetTaskStatus(ctx echo.Context) error
// Delete a task item by ID
// (DELETE /task/{id})
DeleteTaskID(ctx echo.Context, id uint64) error
// Get a task item by ID
// (GET /task/{id})
GetTaskID(ctx echo.Context, id uint64) error
}
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
func (*ServerInterfaceWrapper) DeleteTaskID ¶
func (w *ServerInterfaceWrapper) DeleteTaskID(ctx echo.Context) error
DeleteTaskID converts echo context to params.
func (*ServerInterfaceWrapper) GetTask ¶
func (w *ServerInterfaceWrapper) GetTask(ctx echo.Context) error
GetTask converts echo context to params.
func (*ServerInterfaceWrapper) GetTaskID ¶
func (w *ServerInterfaceWrapper) GetTaskID(ctx echo.Context) error
GetTaskID converts echo context to params.
func (*ServerInterfaceWrapper) GetTaskStatus ¶
func (w *ServerInterfaceWrapper) GetTaskStatus(ctx echo.Context) error
GetTaskStatus converts echo context to params.
type TaskErrorResponse ¶
type TaskErrorResponse struct {
// Code The error code.
Code int `json:"code"`
// Details Additional details about the error, specifying which component failed.
Details *string `json:"details,omitempty"`
// Error A description of the error that occurred.
Error string `json:"error"`
}
TaskErrorResponse defines model for task.ErrorResponse.
type TaskItemIdResponse ¶
type TaskItemIdResponse struct {
// Id Unique identifier of the task item.
Id *uint64 `json:"id,omitempty"`
}
TaskItemIdResponse defines model for TaskItemIdResponse.
type TaskItemResponse ¶
type TaskItemResponse struct {
// Body Base64-encoded representation of the body of the task item.
Body *[]byte `json:"body,omitempty"`
// Created Creation timestamp of the task item.
Created *time.Time `json:"created,omitempty"`
// Id Unique identifier of the task item.
Id *uint64 `json:"id,omitempty"`
}
TaskItemResponse defines model for TaskItemResponse.
type TaskResponse ¶
type TaskResponse struct {
Items *[]TaskItemResponse `json:"items,omitempty"`
// TotalItems The total number of task items.
TotalItems *int `json:"total_items,omitempty"`
}
TaskResponse defines model for TaskResponse.
type TaskStatusResponse ¶
type TaskStatusResponse struct {
// TotalItems The total number of task items.
TotalItems *int `json:"total_items,omitempty"`
}
TaskStatusResponse defines model for TaskStatusResponse.