Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/akshayur04/golang-assignment-totalitycorp
https://github.com/akshayur04/golang-assignment-totalitycorp
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/akshayur04/golang-assignment-totalitycorp
- Owner: akshayUr04
- Created: 2023-10-29T06:09:54.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-29T10:25:01.000Z (about 1 year ago)
- Last Synced: 2024-11-07T12:52:17.609Z (about 2 months ago)
- Language: Go
- Size: 71.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TOTALITY CORP ASSIGNMENT
## Introduction
Microservie created by using GO and gRPC.
This project consits of a gRPC service and an API gateway.
Follow the given steps to run and test assignment.
### Installation
#### 1. Clone the repository:
```bash
git clone https://github.com/akshayUr04/golang-assignment-totalitycorp.git && \
cd ./golang-assignment-totalitycorp
```### 1. API Gateway
##### 1. Install dependencies
```bash
## Assuming you are in root of the project
cd ./apigateway && \
go mod tidy
```##### 2. Setup Env
create a .env file and add the below values
```bash
## check the .env.example
PORT = "port that you need to run the api gateway"
USERSVCPORT = "port that the server is running"
```##### 3. Run Application
```bash
go run ./cmd/api
or
make server
```### 2. Server
##### 1. Install dependencies
```bash
## Assuming you are in root of the project
cd ./totalitycorp-service && \
go mod tidy
```
##### 2. Setup Env
create a .env file and add the below values
```bash
## check the .env.example
PORT = "port that you need to run the server"
```##### 3. Run Application
```bash
go run ./cmd/api
or
make server
```### Run Application using Docker
```bash
## Assuming you are in root of the project
docker compose up
```
### Test Application using Postman
##### 1.Get By ID
![Alt text](./assets/getByID.png)
##### 1.Get By Multiple IDs
![Alt text](./assets/getByIDs.png)### Run Unit Test
```bash
cd ./totalitycorp-service/pkg/service
go test
```