go-skeleton-chi

command module
v0.0.0-...-e79c8f7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2024 License: MIT Imports: 10 Imported by: 0

README

go-skeleton-chi

Skeleton project golang with framework go-chi / Chi

Development Guide

Collection Using Postman
  • ./go-skeleton.postman_collection.json
Installation
  • Clone this repo

    git clone https://github.com/adamnasrudin03/go-skeleton-chi.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:

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
app
dto
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL