Skeleton project golang with framework Gin / Gin-gonic
- ./go-skeleton.postman_collection.json
-
Clone this repo
git clone https://github.com/adamnasrudin03/go-skeleton-gin.git
-
Copy
.env.example
to.env
cp .env.example .env
-
Setup local database
-
Start service API
go run main.go
make cover
- 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
- 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"
}
}