A simple Todo API built with Go and Gin framework as part of the 0x0_Golang learning pathway.
Retrieve a list of all todos.
Retrieve a single todo by ID.
Toggle the status of a single todo by ID.
Create a new todo.
To run the API, simply execute the following command in your terminal:
go run .
The API will be available at http://localhost:9090.
Note This project is part of my learning journey in Go, specifically for the 0x0_Golang learning pathway. It's a basic implementation and you may want to add authentication, error handling, and other features depending on your requirements.
The project consists of the following packages:
main: The main package handles the server execution and api endpoints definition.
controller: This package contains the controller functions that handle the API requests.
types: This package contains type definition for each todo task
data: This package contains the sample todo data and functions for managing todo data
This project aims to cover the following learning objectives:
- Setting up a Gin router and defining API endpoints
- Creating controller functions to handle API requests
- Using Go to build a simple RESTful API
Next Steps
- Explore other features and best practices for building a robust API in Go.