Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/moemoe89/go-redis-danu

👐 This repo for practicing Redis using Golang (Gin Framework), Docker, Travis CI and Codecov
https://github.com/moemoe89/go-redis-danu

codecov docker gin go golang redis travis-ci

Last synced: about 1 month ago
JSON representation

👐 This repo for practicing Redis using Golang (Gin Framework), Docker, Travis CI and Codecov

Awesome Lists containing this project

README

        

[![Build Status](https://travis-ci.org/moemoe89/go-redis-danu.svg?branch=master)](https://travis-ci.org/moemoe89/go-redis-danu)
[![codecov](https://codecov.io/gh/moemoe89/go-redis-danu/branch/master/graph/badge.svg)](https://codecov.io/gh/moemoe89/go-redis-danu)
[![Go Report Card](https://goreportcard.com/badge/github.com/moemoe89/go-redis-danu)](https://goreportcard.com/report/github.com/moemoe89/go-redis-danu)

# GO-REDIS-DANU #

Practicing Redis Using Golang (Gin Gonic Framework) as Programming Language, Redis as Database

## Directory structure
Your project directory structure should look like this
```
+ your_gopath/
|
+--+ src/github.com/moemoe89
| |
| +--+ go-redis-danu/
| |
| +--+ main.go
| + api/
| + routers/
| + ... any other source code
|
+--+ bin/
| |
| +-- ... executable file
|
+--+ pkg/
|
+-- ... all dependency_library required

```

## Setup and Build

* Setup Golang
* Setup Redis
* Under `$GOPATH`, do the following command :
```
$ mkdir -p src/github.com/moemoe89
$ cd src/github.com/moemoe89
$ git clone
$ mv go-redis-danu
```

## 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