You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: samples/protoc-gen-extensions/README.md
+75-8Lines changed: 75 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,19 +2,87 @@
2
2
3
3
This sample shows how to use proto3 extensions (`MethodOptions` more specifically) and the `protogen.Registry` to resolve messages.
4
4
5
-
## Run
5
+
## How to access extensionn values
6
6
7
-
For a plugin that uses extensions the extension needs to be generated first using the official protoc python compiler.
8
-
This is necessary for the corresponding options that use e.g. in `samples/protos/acme/library/v1/library.proto` to be present and accessible for the example plugin.
9
-
Generate python code for at least the file where the extension resides in and all its dependencies with the official Python protoc plugin.
7
+
This example works with the following `MethodOption` extension that can be found in [../protos/acme/longrunning/operations.proto](../protos/acme/longrunning/operations.proto):
For a plugin that should recognize this extensions the extension proto file and its dependencies need to be generated first using the official protoc python compiler.
43
+
Generate python code for at least the file where the extension resides in and all its dependencies with the official Python protoc plugin:
0 commit comments