todo

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

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 CreateTodoResponse struct {
	ID      string `json:"id"`
	Title   string `json:"title"`
	Details string `json:"details"`
	Status  string `json:"status"`
}

type DbRepository

type DbRepository interface {
	Create(ctx context.Context, t *model.Todo) error
	GetByID(ctx context.Context, id string) (*model.Todo, error)
	Update(ctx context.Context, t *model.Todo) error
	Delete(ctx context.Context, id string) error
	List(ctx context.Context, status string) ([]*model.Todo, error)
}

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 GetTodoResponse struct {
	ID      string `json:"id"`
	Title   string `json:"title"`
	Details string `json:"details"`
	Status  string `json:"status"`
}

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 */
}

type UpdateTodoResponse

type UpdateTodoResponse struct {
	ID      string `json:"id"`
	Title   string `json:"title"`
	Details string `json:"details"`
	Status  string `json:"status"`
}

Jump to

Keyboard shortcuts

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