https://github.com/borud/bufbuild-import-demo
Just a quick demo of how you can use automatically generated protobuffer and gRPC code from buf.build
https://github.com/borud/bufbuild-import-demo
Last synced: 7 months ago
JSON representation
Just a quick demo of how you can use automatically generated protobuffer and gRPC code from buf.build
- Host: GitHub
- URL: https://github.com/borud/bufbuild-import-demo
- Owner: borud
- License: apache-2.0
- Created: 2022-01-04T16:16:54.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-04T16:19:14.000Z (over 4 years ago)
- Last Synced: 2024-06-21T03:25:22.385Z (almost 2 years ago)
- Language: Go
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# buf.build demo
The purpose of this repository is to demonstrate how to use the services offered by [buf.build](https://buf.build/) for hosting protobuffer definitions and automatic code generation for protobuffers and gRPC services.
This means that the developer **does not have to**:
- install the `buf` tool
- does not have to deal directly with the `.proto` files
- does not have to do code generation
## Building
If you have Go and make installed you should be able to just execute
```shell
make
```
to build the project. The binaries will be in `bin`.
## How do you use it?
In this example we are using the [gwp](https://buf.build/borud/gwp) module hosted on [buf.build](https://buf.build/).
If you look in [cmd/server/main.go](cmd/server/main.go) you simply add `"go.buf.build/library/go-grpc/borud/gwp"` to your imports, run `go mod tidy` and that's that. Now you can use all the generated types from the project.
The docs for the API are hosted here.
## Limited to Go (for now)
For now code generation is only offered for Go, but C++ and other languages are on their way.