Skip to content

ix21027/taskmanager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task Manager

Task Manager is a RESTful API built with Go and Gin for managing tasks. It supports CRUD operations, caching with TTL, pagination, filtering, and structured logging with Logrus. The project uses PostgreSQL as the database and is containerized with Docker.

Features

  • CRUD Operations: Create, read, update, and delete tasks.
  • Caching: In-memory caching with TTL for task retrieval.
  • Pagination and Filtering: List tasks with pagination and status filtering.
  • Logging: Structured logging of HTTP requests using Logrus.
  • Docker Support: Run the application and database with Docker Compose.
  • Comprehensive Tests: Unit and integration tests for models, repository, services, and handlers.

To build and run the application:

docker-compose up --build

The API will be available at http://localhost:8080.

API Examples

Create Task

curl -X POST http://localhost:8080/tasks \
  -H "Content-Type: application/json" \
  -d '{"title":"Test Task","description":"Description","status":"todo"}'

List Tasks

curl "http://localhost:8080/tasks?page=1&page_size=5&status=todo"

Update Task

curl -X PUT http://localhost:8080/tasks/<id> \
  -H "Content-Type: application/json" \
  -d '{"title":"Updated Task","description":"Updated","status":"in_progress"}'

Delete Task

curl -X DELETE http://localhost:8080/tasks/<id>

About

Test project

Resources

Stars

Watchers

Forks

Contributors