https://github.com/lordvidex/go-example-server
https://github.com/lordvidex/go-example-server
docker-compose golang grpc-go rest-api
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/lordvidex/go-example-server
- Owner: lordvidex
- License: mit
- Created: 2022-06-12T18:58:39.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-06-20T18:46:35.000Z (about 4 years ago)
- Last Synced: 2024-11-15T00:59:49.923Z (over 1 year ago)
- Topics: docker-compose, golang, grpc-go, rest-api
- Language: Go
- Homepage:
- Size: 8.56 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# go-example-server
Learning golang for servers and microservices
## How To Run?
> ### Server
The server processes can be started `locally` with the make command below.
**REST and gRPC servers**
```bash
make server # starts the REST & gRPC server
```
OR
**Docker**
```bash
docker-compose up
```
> ### Client
#### HTTP
**HTTP client**
```bash
curl http://localhost:3000/product # all items
curl https://localhost:3000/product/1 # single item
```
#### GRPC
**gRPC client**
```bash
bash ./client.sh # returns a single item through gRPC
bash ./client.sh -all # returns a stream of items through gRPC
```
OR.
**with [grpcurl](https://pkg.go.dev/github.com/fullstorydev/grpcurl#section-readme)**
```bash
grpcurl -d '{"id": "2"}' --plaintext localhost:3000 Product.GetProduct # get single
grpcurl --plaintext localhost:3000 Product.GetProducts # get all
```
### **DockerHub** *pull project directly from docker*
Project can be pulled from docker hub and run directly from docker
```bash
docker pull lordvidex/goserver:latest
```