Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rahulkp220/coinsph
Go microservice project
https://github.com/rahulkp220/coinsph
Last synced: 13 days ago
JSON representation
Go microservice project
- Host: GitHub
- URL: https://github.com/rahulkp220/coinsph
- Owner: rahulkp220
- Created: 2021-05-09T12:06:15.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-05-09T14:44:01.000Z (over 3 years ago)
- Last Synced: 2024-12-08T14:42:10.791Z (15 days ago)
- Language: Go
- Size: 37.1 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Go microservice using Go Kit
This is a project that takes advantage of the `go-kit` framework and creates microservices.### Installation
##### Clone this repository in your `GOPATH` usually at
- `/Users//go/src/` for `Mac`
- `/home//go/src/` for `Linux`##### Setting up the database
- Create database `coinsph` for the user `postgres`
- Create a table `accounts`
```
CREATE TABLE accounts (Id VARCHAR (100) UNIQUE NOT NULL, username VARCHAR (50) UNIQUE NOT NULL, currency VARCHAR (20) NOT NULL, balance VARCHAR (100) NOT NULL);
```- Create another table `payments`
```
CREATE TABLE payments (id VARCHAR(100) UNIQUE NOT NULL, sender VARCHAR(100) NOT NULL, reciever VARCHAR(100) NOT NULL, amount NUMERIC NOT NULL, initiated TIME NOT NULL, completed TIME NOT NULL);
```##### Run server
`go run main.go` exposing the service locally on port `8080`### Code Linting
The linter used here is `golangci-lint` and to run it, simple go within the root of the repo and run `golangci-lint run`### Running the service using docker
- ~~`docker build -t coinsph-dev .`~~
- ~~`docker scan` for any vulnerabilities (optional)~~
- ~~`docker run -it -p 8080:8080 coinsph-dev`~~