Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/moemoe89/go-mongodb-gita
🎙️ This repo for practicing MongoDB using Golang (Gin Framework), Docker, Travis CI and Coveralls
https://github.com/moemoe89/go-mongodb-gita
coveralls docker gin go golang mongodb travis-ci
Last synced: about 1 month ago
JSON representation
🎙️ This repo for practicing MongoDB using Golang (Gin Framework), Docker, Travis CI and Coveralls
- Host: GitHub
- URL: https://github.com/moemoe89/go-mongodb-gita
- Owner: moemoe89
- License: mit
- Created: 2016-11-22T23:09:07.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-08-22T08:57:21.000Z (over 4 years ago)
- Last Synced: 2023-03-03T16:14:44.197Z (almost 2 years ago)
- Topics: coveralls, docker, gin, go, golang, mongodb, travis-ci
- Language: Go
- Homepage:
- Size: 1.87 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/moemoe89/go-mongodb-gita.svg?branch=master)](https://travis-ci.org/moemoe89/go-mongodb-gita)
[![Coverage Status](https://coveralls.io/repos/github/moemoe89/go-mongodb-gita/badge.svg?branch=master)](https://coveralls.io/github/moemoe89/go-mongodb-gita?branch=master)
[![Go Report Card](https://goreportcard.com/badge/github.com/moemoe89/go-mongodb-gita)](https://goreportcard.com/report/github.com/moemoe89/go-mongodb-gita)# GO-MONGODB-GITA #
Practicing MongoDB Using Golang (Gin Gonic Framework) with Go Mod as Programming Language, MongoDB as Database
## Directory structure
Your project directory structure should look like this
```
+ your_gopath/
|
+--+ src/github.com/moemoe89
| |
| +--+ go-mongodb-gita/
| |
| +--+ main.go
| + api/
| + routers/
| + ... any other source code
|
+--+ bin/
| |
| +-- ... executable file
|
+--+ pkg/
|
+-- ... all dependency_library required```
## Requirements
Go >= 1.11
## Setup and Build
* Setup Golang
* Setup MongoDB
* Under `$GOPATH`, do the following command :
```
$ mkdir -p src/github.com/moemoe89
$ cd src/github.com/moemoe89
$ git clone
$ mv go-mongodb-gita
```## Running Application
Make config file for local :
```
$ cp config-sample.json config-local.json
```
Build
```
$ go build
```
Run
```
$ go run main.go
```## How to Run with Docker
Make config file for docker :
```
$ cp config-sample.json config-docker.json
```
Build
```
$ docker-compose build
```
Run
```
$ docker-compose up
```
Stop
```
$ docker-compose down
```## How to Run Unit Test
Run
```
$ go test ./...
```
Run with cover
```
$ go test ./... -cover
```
Run with HTML output
```
$ go test ./... -coverprofile=c.out && go tool cover -html=c.out
```## License
MIT