File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ # GAPIC Generator Go (` gapic-generator-go ` ) Context
2+
3+ ## Repository Overview
4+ This is the ** code generator** . It reads Protocol Buffers and generates the Go client code found in ` google-cloud-go ` .
5+
6+ ## Key Directories
7+ * ` cmd/protoc-gen-go_gapic/ ` : The entry point for the ` protoc ` plugin. Start here to trace execution.
8+ * ` internal/gengapic/ ` : This directory contains the ** core logic** for generating the Go code.
9+ * If you need to change * how* code is generated (e.g., changing the format of a client method), this is where you look.
10+ * ` internal/snippets/ ` : Code for generating documentation snippets.
11+
12+ ## Architecture & Wiring (Code Generation)
13+ * ** Client Constructors (` internal/gengapic/client_init.go ` ):** Generates the ` NewClient ` and ` NewRESTClient ` functions.
14+ * ** Edit here:** If you need to change how clients are initialized (e.g., adding default options or transport configuration).
15+ * ** Method Generation:**
16+ * ` internal/gengapic/gengrpc.go ` : Generates gRPC methods.
17+ * ` internal/gengapic/genrest.go ` : Generates REST (HTTP) methods.
18+ * ** Edit here:** To inject logic at the call site (e.g., adding attributes to the context before the RPC).
19+
20+ ## Workflow
21+ * To test changes, you typically need to:
22+ 1 . Build this generator.
23+ 2 . Run it against a sample proto (often found in ` google-cloud-go ` or a test workspace).
24+ 3 . Inspect the generated output.
You can’t perform that action at this time.
0 commit comments