Skip to content

Commit f3615f3

Browse files
authored
feature: add tags to proto files for quickstart (#232)
1 parent f95771e commit f3615f3

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed

samples/customer-registry-quickstart/src/main/proto/customer/customer_api.proto

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
// tag::declarations[]
16+
1517
syntax = "proto3";
1618

1719
package customer.api;
@@ -21,6 +23,10 @@ option java_outer_classname = "CustomerApi";
2123
import "google/protobuf/empty.proto";
2224
import "akkaserverless/annotations.proto";
2325

26+
// end::declarations[]
27+
28+
// tag::messages[]
29+
2430
message Customer {
2531
string customer_id = 1 [(akkaserverless.field).entity_key = true];
2632
string email = 2;
@@ -33,6 +39,10 @@ message Address {
3339
string city = 2;
3440
}
3541

42+
// end::messages[]
43+
44+
// tag::method-messages[]
45+
3646
message GetCustomerRequest {
3747
string customer_id = 1 [(akkaserverless.field).entity_key = true];
3848
}
@@ -47,6 +57,11 @@ message ChangeAddressRequest {
4757
Address new_address = 2;
4858
}
4959

60+
// end::method-messages[]
61+
62+
63+
// tag::service[]
64+
5065
service CustomerService {
5166
option (akkaserverless.service) = {
5267
type: SERVICE_TYPE_ENTITY
@@ -61,3 +76,4 @@ service CustomerService {
6176

6277
rpc GetCustomer(GetCustomerRequest) returns (Customer) {}
6378
}
79+
// end::service[]

samples/customer-registry-quickstart/src/main/proto/customer/customer_domain.proto

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
// tag::declarations[]
16+
1517
syntax = "proto3";
1618

1719
package customer.domain;
@@ -20,12 +22,20 @@ option java_outer_classname = "CustomerDomain";
2022

2123
import "akkaserverless/annotations.proto";
2224

23-
option (akkaserverless.file).value_entity = { // <1>
25+
// end::declarations[]
26+
27+
// tag::entity[]
28+
29+
option (akkaserverless.file).value_entity = {
2430
name: "Customer"
2531
entity_type: "customers"
2632
state: "CustomerState"
2733
};
2834

35+
// end::entity[]
36+
37+
// tag::domain[]
38+
2939
message CustomerState {
3040
string customer_id = 1;
3141
string email = 2;
@@ -37,3 +47,5 @@ message Address {
3747
string street = 1;
3848
string city = 2;
3949
}
50+
51+
// end::domain[]

samples/customer-registry-quickstart/src/main/proto/customer/customer_view.proto

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
// tag::declarations[]
16+
1517
syntax = "proto3";
1618

1719
package customer.view;
@@ -21,6 +23,10 @@ option java_outer_classname = "CustomerViewModel";
2123
import "customer/customer_domain.proto";
2224
import "akkaserverless/annotations.proto";
2325

26+
// end::declarations[]
27+
28+
// tag::name[]
29+
2430
service CustomerByName {
2531
option (akkaserverless.service) = {
2632
type: SERVICE_TYPE_VIEW
@@ -46,6 +52,10 @@ message ByNameRequest {
4652
string customer_name = 1;
4753
}
4854

55+
// end::name[]
56+
57+
58+
// tag::email[]
4959
service CustomerByEmail {
5060
option (akkaserverless.service) = {
5161
type: SERVICE_TYPE_VIEW
@@ -70,3 +80,4 @@ service CustomerByEmail {
7080
message ByEmailRequest {
7181
string email = 1;
7282
}
83+
// end::email[]

0 commit comments

Comments
 (0)