Skip to content

Commit

Permalink
Update readme for release (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
anuraaga authored Dec 21, 2023
1 parent 99b8331 commit 289a892
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

0 comments on commit 289a892

Please sign in to comment.