Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/moemoe89/go-elasticsearch-tita
🤘 Practicing Elasticsearch using Golang (Gin Framework), Docker, Travis CI and Coveralls
https://github.com/moemoe89/go-elasticsearch-tita
coveralls docker elasticsearch gin go golang travis-ci
Last synced: about 1 month ago
JSON representation
🤘 Practicing Elasticsearch using Golang (Gin Framework), Docker, Travis CI and Coveralls
- Host: GitHub
- URL: https://github.com/moemoe89/go-elasticsearch-tita
- Owner: moemoe89
- License: mit
- Created: 2019-11-07T14:19:57.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-14T15:42:06.000Z (over 4 years ago)
- Last Synced: 2024-11-16T15:38:14.832Z (about 1 month ago)
- Topics: coveralls, docker, elasticsearch, gin, go, golang, travis-ci
- Language: Go
- Homepage:
- Size: 22.3 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-elasticsearch-tita.svg?branch=master)](https://travis-ci.org/moemoe89/go-elasticsearch-tita)
[![Coverage Status](https://coveralls.io/repos/github/moemoe89/go-elasticsearch-tita/badge.svg?branch=master)](https://coveralls.io/github/moemoe89/go-elasticsearch-tita?branch=master)
[![Go Report Card](https://goreportcard.com/badge/github.com/moemoe89/go-elasticsearch-tita)](https://goreportcard.com/report/github.com/moemoe89/go-elasticsearch-tita)# GO-ELASTICSEARCH-TITA #
Practicing Elasticsearch Using Golang (Gin Gonic Framework) as Programming Language, Elasticsearch as Search Engine Based
## Directory structure
Your project directory structure should look like this
```
+ your_gopath/
|
+--+ src/github.com/moemoe89
| |
| +--+ go-elasticsearch-tita/
| |
| +--+ main.go
| + api/
| + routers/
| + ... any other source code
|
+--+ bin/
| |
| +-- ... executable file
|
+--+ pkg/
|
+-- ... all dependency_library required```
## Setup and Build
* Setup Golang
* Setup Elasticsearch
* Under `$GOPATH`, do the following command :
```
$ mkdir -p src/github.com/moemoe89
$ cd src/github.com/moemoe89
$ git clone
$ mv go-elasticsearch-tita
```## Running Application
Make config file for local :
```
$ cp config-sample.json config.json
```
Change Elasticsearch address based on your config :
```
http://:9200
```
Build
```
$ go build
```
Run
```
$ go run main.go
```## How to Run with Docker
Make config file for docker :
```
$ cp config-sample.json config.json
```
Change Elasticsearch address based on your docker config :
```
http://elasticsearch:9200
```
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