Documentation
¶
Overview ¶
Package server provides primitives to interact with the openapi HTTP API.
Code generated by unknown module path version unknown version DO NOT EDIT.
Index ¶
- func RegisterHandlers(router EchoRouter, si ServerInterface)
- func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
- type EchoRouter
- type PostTodosJSONBody
- type PostTodosJSONRequestBody
- type PutTodosTodoIdJSONBody
- type PutTodosTodoIdJSONRequestBody
- type Server
- func (s *Server) AllToDos() []*ToDo
- func (s *Server) CreateToDo(todo *ToDo)
- func (s *Server) DeleteToDo(todoId int)
- func (s *Server) DeleteTodosTodoId(ctx echo.Context, todoId int) error
- func (s *Server) GetTodos(ctx echo.Context) error
- func (s *Server) PostTodos(ctx echo.Context) error
- func (s *Server) PutTodosTodoId(ctx echo.Context, todoId int) error
- func (s *Server) Start(port string) error
- func (s *Server) UpdateToDo(todo *ToDo)
- type ServerInterface
- type ServerInterfaceWrapper
- type ToDo
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 PostTodosJSONBody ¶
type PostTodosJSONBody ToDo
PostTodosJSONBody defines parameters for PostTodos.
type PostTodosJSONRequestBody ¶
type PostTodosJSONRequestBody PostTodosJSONBody
PostTodosJSONRequestBody defines body for PostTodos for application/json ContentType.
type PutTodosTodoIdJSONBody ¶
type PutTodosTodoIdJSONBody ToDo
PutTodosTodoIdJSONBody defines parameters for PutTodosTodoId.
type PutTodosTodoIdJSONRequestBody ¶
type PutTodosTodoIdJSONRequestBody PutTodosTodoIdJSONBody
PutTodosTodoIdJSONRequestBody defines body for PutTodosTodoId for application/json ContentType.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) CreateToDo ¶
func (*Server) DeleteToDo ¶
func (*Server) DeleteTodosTodoId ¶
func (*Server) UpdateToDo ¶
type ServerInterface ¶
type ServerInterface interface {
// (GET /todos)
GetTodos(ctx echo.Context) error
// (POST /todos)
PostTodos(ctx echo.Context) error
// (DELETE /todos/{todoId})
DeleteTodosTodoId(ctx echo.Context, todoId int) error
// (PUT /todos/{todoId})
PutTodosTodoId(ctx echo.Context, todoId int) error
}
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
func (*ServerInterfaceWrapper) DeleteTodosTodoId ¶
func (w *ServerInterfaceWrapper) DeleteTodosTodoId(ctx echo.Context) error
DeleteTodosTodoId converts echo context to params.
func (*ServerInterfaceWrapper) GetTodos ¶
func (w *ServerInterfaceWrapper) GetTodos(ctx echo.Context) error
GetTodos converts echo context to params.
func (*ServerInterfaceWrapper) PostTodos ¶
func (w *ServerInterfaceWrapper) PostTodos(ctx echo.Context) error
PostTodos converts echo context to params.
func (*ServerInterfaceWrapper) PutTodosTodoId ¶
func (w *ServerInterfaceWrapper) PutTodosTodoId(ctx echo.Context) error
PutTodosTodoId converts echo context to params.