grpc-api-example/README.md

34 lines
935 B
Markdown
Raw Normal View History

2024-02-26 10:12:30 +00:00
# grpc-api-example
This repository demonstrates how to use gRPC with Go and various plugins. It's a simple API to manage notes. It uses grpc-gateway to handle HTTP requests and openapi to define API specs.
2024-02-28 12:05:55 +00:00
## Demonstrated features
- buf.build framework
- grpc gateway + openapi specs and swagger UI
- graceful server shut down (designed for orchestration systems such as k8s)
- gRPC [health check protocol](https://github.com/grpc/grpc/blob/master/doc/health-checking.md#grpc-health-checking-protocol).
- rpc message validation
⚠️ For demo purposes, encryption wasn't properly handled in this project.
2024-02-26 10:12:30 +00:00
## Installation
This project uses go1.20.
```
$ make install-tools
2024-02-28 12:05:55 +00:00
$ make build
2024-02-26 10:12:30 +00:00
```
### Run the server
```
2024-02-28 12:05:55 +00:00
$ ./bin/server -h
Usage of ./bin/server:
-grpc-server-endpoint string
gRPC server endpoint (default "localhost:9090")
-http-server-endpoint string
HTTP server endpoint (default "localhost:8000")
```