Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marioidival/brincation-go
https://github.com/marioidival/brincation-go
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/marioidival/brincation-go
- Owner: marioidival
- License: mit
- Created: 2022-03-27T13:53:19.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-03-28T18:16:54.000Z (over 2 years ago)
- Last Synced: 2024-11-01T01:09:42.095Z (about 2 months ago)
- Language: Go
- Size: 111 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Brincation Go
Just for fun weekend project about microservices and RPC communication.
## How To
To run this project, you will need of [docker-compose](https://docs.docker.com/compose/install/) on your machine.
After installation, you can run:
```bash
$ docker-compose up
```The command above will build and run the docker images, because we have two services.
#### clientapi
When the project starts, it loads all the items from the [ports.json](./ports.json) file into the `portdomainservice` project via RPC calls. It also has a Rest API that allows you to search ports using your ID.
#### portdomainservice
The service is responsible for saving the ports into database. It uses a simple memory database that can manage concurrent calls.
### Tech stack
- Golang
- RPC using Twirp
- Docker and Docker Compose### Project structure
#### cmd folder
This folder contains the two services (clientapi, portdomainservice) that are used in the project. Here a binary is assembled with all its dependencies, depending on the project and needs.
#### internal folder
This folder we have two others folders that contain the portdomainservice repository logic (repo folder) and the portdomainservice server implementation (server folder).
#### pkg folder
This folder we build the memory database used by portdomainservice.
#### rpc folder
This folder we build the .proto file used by portdomainservice. Here is only allowed edit the .proto file. The *pb.go and *twirp.go are build using this command:
```bash
$ protoc --go_out=paths=source_relative:. --twirp_out=paths=source_relative:. rpc/ports.proto
```