Skip to content

Golang + HTTP + JSON/MySQL/PostgreSQL + RabbitMQ + Swagger UI Native + Unit Testing (PT Phincon Bootcamp Task) - Fundamental Golang Web Service

Notifications You must be signed in to change notification settings

rafli-ramadhan/sales-go

Repository files navigation

Go REST API with JSON / MySQL / PostgreSQL

Sales Program using JSON or Database (PT. Phincon Bootcamp Exercise)

Prerequisite

  • Go 1.19.7 or higher version
  • MySQL or PosgtreSQL

Running 🚀

go install
go run main.go

List Endpoints

  • GET localhost:5000/product

  • POST localhost:5000/product

  • GET localhost:5000/voucher

  • POST localhost:5000/voucher

  • GET localhost:5000/transaction

  • POST localhost:5000/transaction

Running Swagger UI

  • Install OpenAPI (Swagger) Editor via VSCode Extensions

  • Open swagger.yml in ./docs

  • Press keyboard F1

  • Choose OpenAPI: show preview using Swagger UI

Running Unit Test

go test ./usecase/product -v -run TestUsecaseProduct
go test ./usecase/transaction -v -run TestUsecaseTransaction
go test ./usecase/voucher -v -run TestUsecaseTransaction
go test ./repository/product -v -run TestRepoProduct
go test ./repository/transaction -v -run TestRepoTransaction
go test ./repository/voucher -v -run TestRepoTransaction

About

Golang + HTTP + JSON/MySQL/PostgreSQL + RabbitMQ + Swagger UI Native + Unit Testing (PT Phincon Bootcamp Task) - Fundamental Golang Web Service

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published