/go-benchmark-api

Project in Golang to Study and Benchmark new Knowledge

Primary LanguageGoMIT LicenseMIT

📊 RESTful API with Go and Gin to Any Benchmarking

🚀 Introduction

This project aims to provide a RESTful API implemented in Go using the Gin framework for benchmarking various sorting algorithms. The API follows the principles of Clean Architecture, emphasizing modularity, testability, and maintainability.

golang logo

📋 Requirements

Note

To start this project, you will need Docker and Docker Compose installed on your machine.

⏳ Next Steps

The project is still under development and the next updates will focus on the following tasks:

  • Implementation of various sorting algorithms (Bubble Sort, Insertion Sort, Merge Sort, Quick Sort, Selection Sort).
  • Serialization support for multiple formats (JSON, Protocol Buffers, FlatBuffers).

📌 Features

  • Dockerized for easy deployment and scalability.
  • Unit tests for all components, including mocks for interfaces.
  • Dependency injection for managing dependencies and facilitating testing.

🛠️ Project Structure

The project follows a modular structure inspired by Clean Architecture:

  • cmd/server/main.go: Entry point for the application.
  • docs/: Documentation files and assets.
  • di/: Dependency injection configurations for various components.
  • internal/: Core application logic.
    • application/: Use cases and DTOs.
    • domain/entity/: entities.
    • infrastructure/api/: API controllers and routes.
    • infrastructure/repository/: Repository implementations.
  • pkg/: Reusable packages and utilities.
  • tests/: Test helpers and mocks.

✅ Installation

To run the project, ensure you have Go and Docker installed on your machine. Then, follow these steps:

  1. Clone the repository.
  2. Navigate to the project directory.
  3. Run docker-compose up --build to start the application.
docker-compose up --build

🌟 Usage

Once the application is running, you can interact with the API using tools like Postman or cURL. Here are some sample endpoints:

http://localhost:3000/api
  • /health: Check the health of the API.
  • /benchmark/sort: Benchmark different sorting algorithms.

✌️ Acknowledgements

Hi, I'm Brazilian, my name is Diego Marques Vieira and my English isn't the best haha. This project is just to implement clean code and clean architecture study in Golang, thanks for reviewing and if you can leave a star 🌟!

study gif

📝 License

This project is licensed under the MIT License. See the LICENSE file for details.