Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/adamnasrudin03/go-skeleton-mux

Skeleton project Golang with framework Gorilla Mux
https://github.com/adamnasrudin03/go-skeleton-mux

skeleton-template

Last synced: 2 days ago
JSON representation

Skeleton project Golang with framework Gorilla Mux

Awesome Lists containing this project

README

        

# go-skeleton-mux
Skeleton project golang with framework Gorilla Mux

## Development Guide

### Collection Using Postman
- ./go-skeleton.postman_collection.json

### Installation
- Clone this repo
```sh
git clone https://github.com/adamnasrudin03/go-skeleton-mux.git
```

- Copy `.env.example` to `.env`

```sh
cp .env.example .env
```
- Setup local database
- Start service API
```sh
go run main.go
```

### Coverage Unit test
```sh
make cover
```

## Build project by docker
- check ip address in terminal
```sh
ipconfig
```
- change data environment in file ./docker-compose.yml
- build with docker compose
```sh
docker-compose -f "docker-compose.yml" up -d --build
```
- with make file
```sh
make docker-compose
```

## Structure Response RESTfull API
- Error
```json
{
"status": "status error",
"code": 10, // code custom error
"message": {
"id": "message error language Indonesian",
"en": "message error language English"
}
}
```

- Success Single Data
```json
{
"status": "Created",
"data": {}
}
```

- Success Multiple Data
```json
{
"status": "Success",
"meta": {
"page": 1,
"limit": 10,
"total_records": 3,
"total_pages": 1
},
"data": []
}
```

- Success response message
```json
{
"status": "Created",
"message": "data created"
}
```

- Success response Multiple message
```json
{
"status": "Created",
"message": {
"id": "Data berhasil dibuat",
"en": "Data created successfully"
}
}
```



Connect with me:




linkedin logo


blog