Skip to content

adamnasrudin03/go-skeleton-mux

Repository files navigation

go-skeleton-mux

Skeleton project golang with framework Gorilla Mux

Development Guide

Collection Using Postman

  • ./go-skeleton.postman_collection.json

Installation

  • Clone this repo

    git clone https://github.com/adamnasrudin03/go-skeleton-mux.git
  • Copy .env.example to .env

    cp .env.example .env
  • Setup local database

  • Start service API

    go run main.go

Coverage Unit test

  make cover

Build project by docker

  • check ip address in terminal
        ipconfig
  • change data environment in file ./docker-compose.yml
  • build with docker compose
        docker-compose -f "docker-compose.yml" up -d --build 
    • with make file
        make docker-compose

Structure Response RESTfull API

  • Error
{
  "status": "status error",
  "code": 10, // code custom error
  "message": {
    "id": "message error language Indonesian",
    "en": "message error language English"
  }
}
  • Success Single Data
{
  "status": "Created",
  "data": {}
}
  • Success Multiple Data
{
  "status": "Success",
  "meta": {
    "page": 1,
    "limit": 10,
    "total_records": 3,
    "total_pages": 1
  },
  "data": []
}
  • Success response message
{
  "status": "Created",
  "message": "data created"
}
  • Success response Multiple message
{
  "status": "Created",
  "message": {
    "id": "Data berhasil dibuat",
    "en": "Data created successfully"
  }
}

Connect with me:

Releases

No releases published

Packages

No packages published