go-grpc
is a sample Go project that implements gRPC services using ConnectRPC for CRUD operations and streaming functionalities. This project includes a complete server implementation, with various interceptors for logging, authentication, and recovery, as well as a simple client CLI application to run all functionalities implemented.
This repository and the code in it is meant as a source of good practices and an example for any implementations of this kind, to help anyone trying to build similar applications.
- CRUD Service: Create, Read, Update, and Delete operations.
- Stream Service: Uploading files and sending direct messages (bidi).
- Interceptors: Logging, Authentication, and Recovery.
To install the project dependencies, run:
go mod download
To start the gRPC server, use:
go run server/cmd/server/main.go
Run the following command to see the capabilities and usage of the client CLI:
go run client/main.go -h
A number of sample tests are part of the project for the server implementation. These can be run with the following command:
go test -v ./...
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.