-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
11 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,8 @@ package managers such as Homebrew, on any platform that Go supports. | |
|
||
## Installation | ||
|
||
Install the plugin you want using `go install`. | ||
Precompiled binaries are available in the [releases](https://github.com/wasilibs/go-protoc-gen-grpc/releases). | ||
Alternatively, install the plugin you want using `go install`. | ||
|
||
```bash | ||
$ go install github.com/wasilibs/go-protoc-gen-grpc/cmd/protoc-gen-grpc_python@latest | ||
|
@@ -23,7 +24,7 @@ $ protoc --grpc_python_out=out/python -Iprotos protos/helloworld.proto | |
|
||
Note that the filenames of binaries in this repository match protoc conventions so `--plugin` is not needed. | ||
|
||
For [buf][3] users, it can be convenient to use `go run` in `buf.gen.yaml`. | ||
For [buf][3] users, to avoid installation entirely, it can be convenient to use `go run` in `buf.gen.yaml`. | ||
|
||
```yaml | ||
version: v1 | ||
|
@@ -33,13 +34,19 @@ plugins: | |
path: ["go", "run", "github.com/wasilibs/go-protoc-gen-grpc/cmd/protoc-gen-grpc_python@latest"] | ||
``` | ||
If also using [go-protoc][4] for `protoc_path` when generating the non-gRPC protobuf stubs, and invoking | ||
If also using [go-protoc-gen-builtins][4] for generating the non-gRPC protobuf stubs, and invoking | ||
`buf` with `go run`, it is possible to have full protobuf/gRPC generation with no installation of tools, | ||
besides Go itself, on any platform that Go supports. The above examples use `@latest`, but it is | ||
recommended to specify a version, in which case all of the developers on your codebase will use the | ||
same version of the tool with no special steps. | ||
|
||
See a full [example][5] in `go-protoc-gen-builtins`. To generate protos, enter the directory and run | ||
`go run github.com/bufbuild/buf/cmd/[email protected] generate`. As long as your machine has Go installed, | ||
you will be able to generate protos. The first time using `go run` for a command, Go automatically builds | ||
it making it slower, but subsequent invocations should be quite fast. | ||
|
||
[1]: https://github.com/grpc/grpc | ||
[2]: https://wazero.io/ | ||
[3]: https://buf.build/ | ||
[4]: https://github.com/wasilibs/go-protoc | ||
[4]: https://github.com/wasilibs/go-protoc-gen-builtins | ||
[5]: https://github.com/wasilibs/go-protoc-gen-builtins/tree/main/example |