Skip to content

Lukasveiga/golang-product-warehouse-api

Repository files navigation

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"`
}

About

Progress documentation of my first golang api

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published