From e8d3e522f7e20a12d59672e07b97e03c0ff00c06 Mon Sep 17 00:00:00 2001 From: Pawel Kosiec Date: Thu, 24 Feb 2022 17:31:28 +0100 Subject: [PATCH 1/2] Mention gRPC client and server code generation --- community/development/development-guide.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/community/development/development-guide.md b/community/development/development-guide.md index 777570b3..eb0ea5e7 100644 --- a/community/development/development-guide.md +++ b/community/development/development-guide.md @@ -289,6 +289,18 @@ Each time the GraphQL schema changes, you need to update generated resources. To make gen-graphql-resources ``` +### Generate code from Protocol Buffers schema + +This project uses the [`protoc`](https://github.com/protocolbuffers/protobuf) compiler, which generates Go code both for gRPC server and client, based on Protocol Buffers schema. + +In Capact project we have one Protocol Buffers schema for [Storage Backend](https://github.com/capactio/capact/tree/main/pkg/hub/api/grpc/storage_backend.proto) Hub extension. + +Each time the Protocol Buffers schema changes, you need to regenerate Go code. To do this, execute: + +```bash +make gen-grpc-resources +``` + ### Generate documentation For the Capact CLI development we use [Cobra](https://github.com/spf13/cobra) library. The documentation for the CLI is generated automatically based on CLI commands code. From ea47870379b81196eebe4fff213d9496d82a6b09 Mon Sep 17 00:00:00 2001 From: Pawel Kosiec Date: Fri, 25 Feb 2022 09:36:18 +0100 Subject: [PATCH 2/2] Mention plugins for `protoc` --- community/development/development-guide.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/community/development/development-guide.md b/community/development/development-guide.md index eb0ea5e7..c70a41b2 100644 --- a/community/development/development-guide.md +++ b/community/development/development-guide.md @@ -293,6 +293,10 @@ make gen-graphql-resources This project uses the [`protoc`](https://github.com/protocolbuffers/protobuf) compiler, which generates Go code both for gRPC server and client, based on Protocol Buffers schema. +The `protoc` compiler uses the following plugins: +- [`protoc-gen-go`](https://pkg.go.dev/google.golang.org/protobuf/cmd/protoc-gen-go) +- [`protoc-gen-go-grpc`](https://pkg.go.dev/google.golang.org/grpc/cmd/protoc-gen-go-grpc) + In Capact project we have one Protocol Buffers schema for [Storage Backend](https://github.com/capactio/capact/tree/main/pkg/hub/api/grpc/storage_backend.proto) Hub extension. Each time the Protocol Buffers schema changes, you need to regenerate Go code. To do this, execute: