Skip to content

Commit

Permalink
Add to readme re options
Browse files Browse the repository at this point in the history
  • Loading branch information
jackkleeman committed Aug 9, 2024
1 parent 4196ccb commit 06bd0ad
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions protoc-gen-go-restate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
This tool generates Go language bindings of `service`s in protobuf definition
files for Restate.

An example of their use can be found in [examples/codegen](../examples/codegen)

## Usage
Via protoc:
```shell
go install github.com/restatedev/sdk-go/protoc-gen-go-restate@latest
protoc --go_out=. --go_opt=paths=source_relative \
--go-restate_out=. --go-restate_opt=paths=source_relative service.proto
```
Expand All @@ -23,10 +26,28 @@ plugins:
- --pull=always
- -i
- ghcr.io/restatedev/protoc-gen-go-restate:latest
# alternatively if you prefer to install the binary:
# local: protoc-gen-go-restate
out: .
opt: paths=source_relative
```
# Providing options
This protoc plugin supports the service and method extensions defined in
[proto/dev/restate/sdk/go.proto](../proto/dev/restate/sdk/go.proto).
You will need to use these extensions to define virtual objects in proto.
You can import the extensions with the statement `import "dev/restate/sdk/go.proto";`. Protoc will expect an equivalent directory
structure containing the go.proto file either locally, or under any of the
paths provided with `--proto_path`. It may be easier to use
[buf](https://buf.build/docs/bsr/module/dependency-management) to import:
```yaml
# buf.yaml
version: v2
deps:
- buf.build/restatedev/sdk-go
```

# Building a docker image
```
KO_DOCKER_REPO=ghcr.io/restatedev ko build --platform=all -B
Expand Down

0 comments on commit 06bd0ad

Please sign in to comment.