Documentation
¶
Index ¶
- Constants
- Variables
- func NewHTTPHandler(vld *validation.Vld, db DbRepository) *httpHandler
- func NewMCPHandler(log *slog.Logger, vld *validation.Vld, db DbRepository) *mcpHandler
- type CreateTodoRequest
- type CreateTodoResponse
- type DbRepository
- type DeleteTodoRequest
- type DeleteTodoResponse
- type GetTodoRequest
- type GetTodoResponse
- type ListTodosRequest
- type ListTodosResponse
- type UpdateTodoRequest
- type UpdateTodoResponse
Constants ¶
View Source
const ( ErrTodoNotFound = "TODO_NOT_FOUND" ErrTodoCreationFailed = "TODO_CREATION_FAILED" ErrTodoUpdateFailed = "TODO_UPDATE_FAILED" ErrTodoDeleteFailed = "TODO_DELETE_FAILED" )
Variables ¶
View Source
var ErrNotFound = errors.New("Todo not found")
Functions ¶
func NewHTTPHandler ¶
func NewHTTPHandler(vld *validation.Vld, db DbRepository) *httpHandler
func NewMCPHandler ¶
func NewMCPHandler(log *slog.Logger, vld *validation.Vld, db DbRepository) *mcpHandler
Types ¶
type CreateTodoRequest ¶
type CreateTodoRequest struct {
Title string `json:"title" validate:"required,min=1,max=100" jsonschema:"A short summary of the task (1-100 characters)"`
Details string `json:"details,omitempty" validate:"max=500" jsonschema:"A detailed description of the task (max 500 characters)"`
Status string `` /* 142-byte string literal not displayed */
}
type CreateTodoResponse ¶
type DbRepository ¶
type DeleteTodoRequest ¶
type DeleteTodoRequest struct {
ID string `param:"id" json:"id" validate:"required,uuid4" jsonschema:"The UUID of the todo item to be permanently deleted"`
}
type DeleteTodoResponse ¶
type DeleteTodoResponse struct {
Message string `json:"message" jsonschema:"A confirmation message of the operation results"`
}
type GetTodoRequest ¶
type GetTodoRequest struct {
ID string `param:"id" json:"id" validate:"required,uuid4" jsonschema:"The UUID of the todo item to be retrieved"`
}
type GetTodoResponse ¶
type ListTodosRequest ¶
type ListTodosRequest struct {
Status string `` /* 201-byte string literal not displayed */
}
type ListTodosResponse ¶
type ListTodosResponse struct {
Todos []GetTodoResponse `json:"todos" jsonschema:"An array containing the requested todo items"`
Total int `json:"total" jsonschema:"The total number of todos matching the current filter"`
}
type UpdateTodoRequest ¶
type UpdateTodoRequest struct {
ID string `param:"id" json:"id" validate:"required,uuid4" jsonschema:"The UUID of the todo item to be updated"`
Title string `json:"title" validate:"required,min=1,max=100" jsonschema:"The updated short summary of the task (1-100 characters)"`
Details string `json:"details,omitempty" validate:"max=500" jsonschema:"The updated detailed description of the task (max 500 characters)"`
Status string `` /* 142-byte string literal not displayed */
}
Click to show internal directories.
Click to hide internal directories.