Skip to content

Latest commit

 

History

History
72 lines (58 loc) · 1.85 KB

README.md

File metadata and controls

72 lines (58 loc) · 1.85 KB

Golang: Product warehouse API

Overview:

Progress documentation of my first golang API

Outstanding topics:

  • Custom errors;
  • Error handling;
  • Connection with database (PostgreSQL)
  • Migrations (Goose)
  • Unit tests;
  • Integration tests;
  • Logging;
  • Swagger/Open API documentation;
  • Benchmark;

Api

This project is a simple Go application designed to manage products and their stock levels. It consists of two primary data structures: Product and Stock.

Data Structures

Product

The Product struct represents an individual product in the inventory. It contains the following fields:

type Product struct {
	Id int `json:"id"`
	Name string `json:"name"`
	Description string `json:"description"`
	Price float64 `json:"price"`
}

Stock

The Stock struct represents the stock level of a product. It contains the following fields:

type Stock struct {
	Id int `json:"id"`
	Product_id int `json:"product_id"`
	Quantity int `json:"quantity"`
}