Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hosseinmirzapur/simple-microservice
https://github.com/hosseinmirzapur/simple-microservice
Last synced: 13 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/hosseinmirzapur/simple-microservice
- Owner: hosseinmirzapur
- Created: 2023-11-10T15:01:18.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-15T14:58:07.000Z (about 1 year ago)
- Last Synced: 2023-11-15T15:29:17.976Z (about 1 year ago)
- Language: Go
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple Microservice Design (no-database included)
This project is a simple microservice design which mocks an API call for fetching a static price
## Usage
- use this code in your terminal to run the server instance:
```bash
# json server
make json_server# grpc server
make grpc_server
```- you can run your client on top of the server by running this:
```bash
# json client
make json_client# grpc client
make grpc_client
```## Containerization
- Simple run this code to create your own container and run the code:
```bash
# use sudo if needed
# you can use `docker run your_container_name -d` to run the container in detached mode`docker build -t your_container_name .
docker run your_container_name
```## GRPC Requirements
### linux
```bash
sudo apt-get update
sudo apt-get install -y protobuf-compiler
```### MacOS
```bash
brew install protobuff
```### Go dependencies (gRPC and Protobuf)
```bash
go get -u google.golang.org/protobuf/cmd/protoc-gen-go
go install google.golang.org/protobuf/cmd/protoc-gen-gogo get -u google.golang.org/grpc/cmd/protoc-gen-go-grpc
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc
```
---