Documentation
¶
Overview ¶
Package handler provides request handling functionality for the application.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CreateRequest ¶
type CreateRequest struct {
Task string `json:"task" validate:"required"`
}
CreateRequest is the request parameter for creating a new todo
type CustomValidator ¶
type CustomValidator struct {
// contains filtered or unexported fields
}
CustomValidator is a custom validator for the echo framework
func (*CustomValidator) Validate ¶
func (cv *CustomValidator) Validate(i interface{}) error
Validate validates the input struct
type DeleteRequest ¶
type DeleteRequest struct {
ID int `param:"id" validate:"required"`
}
DeleteRequest is the request parameter for deleting a todo
type FindRequest ¶
type FindRequest struct {
ID int `param:"id" validate:"required"`
}
FindRequest is the request parameter for finding a todo
type HealthHandler ¶
HealthHandler is the request handler for the health endpoint.
func NewHealth ¶
func NewHealth() HealthHandler
NewHealth returns a new instance of the health handler.
type ResponseData ¶
type ResponseData struct {
// Data is the response data.
Data interface{} `json:"data,omitempty"`
}
ResponseData is the response structure for the application.
type ResponseError ¶
type ResponseError struct {
// Errors is the response errors.
Errors []Error `json:"errors,omitempty"`
}
ResponseError is the response structure for the application.
type TodoHandler ¶
type TodoHandler interface {
Create(c echo.Context) error
Update(c echo.Context) error
Delete(c echo.Context) error
Find(c echo.Context) error
FindAll(c echo.Context) error
}
TodoHandler is the request handler for the todo endpoint.
func NewTodo ¶
func NewTodo(s service.Todo) TodoHandler
NewTodo returns a new instance of the todo handler.
type UpdateRequest ¶
type UpdateRequest struct {
UpdateRequestBody
UpdateRequestPath
}
UpdateRequest is the request parameter for updating a todo
type UpdateRequestBody ¶
type UpdateRequestBody struct {
Task string `json:"task,omitempty"`
Status model.Status `json:"status,omitempty"`
}
UpdateRequestBody is the request body for updating a todo
type UpdateRequestPath ¶
type UpdateRequestPath struct {
ID int `param:"id" validate:"required"`
}
UpdateRequestPath is the request parameter for updating a todo