Skip to content

Commit 4b3b606

Browse files
committed
Dedupe doc comments, and slot placeholder for Java
1 parent a16bb1e commit 4b3b606

6 files changed

Lines changed: 33 additions & 22 deletions

File tree

protobuf-grpc/pb/echo/v1/echo_pb2_grpc.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66

77

88
class EchoServiceStub(object):
9-
"""Service that shows a few ways to work with protobufs and gRPC
9+
"""TODO: once I figure out how Java works lol
10+
// You also need to specify any other appropriate static options for other
11+
// languages; here's where you specify the Java package name, for example
12+
option java_package = "org.opensourcecorp.workshops.protobuf_grpc.echo.v1";
13+
14+
Service that shows a few ways to work with protobufs and gRPC
1015
"""
1116

1217
def __init__(self, channel):
@@ -23,7 +28,12 @@ def __init__(self, channel):
2328

2429

2530
class EchoServiceServicer(object):
26-
"""Service that shows a few ways to work with protobufs and gRPC
31+
"""TODO: once I figure out how Java works lol
32+
// You also need to specify any other appropriate static options for other
33+
// languages; here's where you specify the Java package name, for example
34+
option java_package = "org.opensourcecorp.workshops.protobuf_grpc.echo.v1";
35+
36+
Service that shows a few ways to work with protobufs and gRPC
2737
"""
2838

2939
def Echo(self, request, context):
@@ -48,7 +58,12 @@ def add_EchoServiceServicer_to_server(servicer, server):
4858

4959
# This class is part of an EXPERIMENTAL API.
5060
class EchoService(object):
51-
"""Service that shows a few ways to work with protobufs and gRPC
61+
"""TODO: once I figure out how Java works lol
62+
// You also need to specify any other appropriate static options for other
63+
// languages; here's where you specify the Java package name, for example
64+
option java_package = "org.opensourcecorp.workshops.protobuf_grpc.echo.v1";
65+
66+
Service that shows a few ways to work with protobufs and gRPC
5267
"""
5368

5469
@staticmethod

protobuf-grpc/pb/employees/v1/employees.pb.go

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protobuf-grpc/pb/employees/v1/employees_grpc.pb.go

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protobuf-grpc/pb/employees/v1/employees_pb2_grpc.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66

77

88
class EmployeesServiceStub(object):
9-
"""Service that shows a few ways to work with protobufs and gRPC
10-
"""
9+
"""Missing associated documentation comment in .proto file."""
1110

1211
def __init__(self, channel):
1312
"""Constructor.
@@ -28,8 +27,7 @@ def __init__(self, channel):
2827

2928

3029
class EmployeesServiceServicer(object):
31-
"""Service that shows a few ways to work with protobufs and gRPC
32-
"""
30+
"""Missing associated documentation comment in .proto file."""
3331

3432
def GetEmployee(self, request, context):
3533
"""Missing associated documentation comment in .proto file."""
@@ -64,8 +62,7 @@ def add_EmployeesServiceServicer_to_server(servicer, server):
6462

6563
# This class is part of an EXPERIMENTAL API.
6664
class EmployeesService(object):
67-
"""Service that shows a few ways to work with protobufs and gRPC
68-
"""
65+
"""Missing associated documentation comment in .proto file."""
6966

7067
@staticmethod
7168
def GetEmployee(request,

protobuf-grpc/proto/echo/v1/echo.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ package echo.v1;
88
// directory structure that your protoc invocation creates!
99
option go_package = "github.com/opensourcecorp/workshops/protobuf-grpc/pb/echo/v1";
1010

11+
// TODO: once I figure out how Java works lol
12+
// // You also need to specify any other appropriate static options for other
13+
// // languages; here's where you specify the Java package name, for example
14+
// option java_package = "org.opensourcecorp.workshops.protobuf_grpc.echo.v1";
15+
1116
// Service that shows a few ways to work with protobufs and gRPC
1217
service EchoService {
1318
rpc Echo(EchoRequest) returns (EchoResponse);

protobuf-grpc/proto/employees/v1/employees.proto

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
syntax = "proto3";
22

3-
// Proto packages should match the directory structure in your tree. The version
4-
// suffix is considered best-practice
53
package employees.v1;
64

7-
// So the Go output knows its own import path -- this needs to match the output
8-
// directory structure that your protoc invocation creates!
95
option go_package = "github.com/opensourcecorp/workshops/protobuf-grpc/pb/employees/v1";
6+
// TODO:
7+
// option java_package = "org.opensourcecorp.workshops.protobuf_grpc.employees.v1";
108

119
// Allow for annotations/options to allow for HTTP transcoding of gRPC requests.
12-
// You can spec & gen these just fine without, but you'll need to use the
13-
// grpc-gateway plugin to take advantage of these annotations
10+
// You can spec & generate these protobufs just fine without, but to actually
11+
// use them, you'll need to use the grpc-gateway plugin to take advantage of
12+
// these annotations
1413
import "google/api/annotations.proto";
1514

16-
// Service that shows a few ways to work with protobufs and gRPC
1715
service EmployeesService {
1816
rpc GetEmployee(GetEmployeeRequest) returns (GetEmployeeResponse) {
17+
// This is where you use those imported annotations above -- this maps GET
18+
// requests over HTTP to the path specified, for example
1919
option (google.api.http) = {
2020
get: "/employees/v1/get_employee/{short_name}"
2121
};

0 commit comments

Comments
 (0)