Skip to content

Example Project REST Full API - Golang, Gin, Gorm, PostgreSQL, Redis, JWT, CORS, Basic Auth, Logging Api, RabbitMQ, Docker, OTP Mechanism, Excel, and more

This project is an example of a REST API project using the Go language and the implementation of other tools, such as Auth with JWT, Basic Auth, Logger API, Cache, ORM SQL, Message Broker, Export Excel File, OTP Mechanism, Deploy with Docker, Clean Code (smell code checker by CodeScene), Unit Test, and so on.

Structure Response API

Error

{
  "status": "status error",
  "code": 10, // code internal error
  "message": {
    "id": "message error language Indonesian",
    "en": "message error language English"
  }
}

Success Single Data

{
  "status": "Created", // status success
  "data": {} // response data
}

Success Multiple Data

{
  "status": "Success", // status success
  "meta": {
    "page": 1, // current page
    "limit": 10, // current limit per page
    "total_records": 3 // total records
  },
  "data": [] // response data
}

Installation

clone the repository, and other installation check here

    git clone https://github.com/adamnasrudin03/go-template.git