-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.proto
48 lines (39 loc) · 1.23 KB
/
example.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
syntax = "proto3";
package example.v1;
option go_package = "github.com/imjoshholloway/protorepo;examplev1";
import "google/api/annotations.proto";
import "protoc-gen-swagger/options/annotations.proto";
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
info: {
title: "Example V1";
version: "1.0";
};
};
// Example is an example service to demonstrate using gRPC to create RPC style services.
//
// Feel free to add a new rpc endpoint here and implement it in the example service.
// Doing this should be a rite of passage for new team members.
service ExampleService {
// HelloWorld responds with "Hello, World".
rpc HelloWorld(HelloWorldRequest) returns (HelloWorldResponse) {
option (google.api.http) = {
get: "/v1/example/hello"
};
}
// HelloUser responds with "Hello, {user}" where the user is retrieved from the request uri.
rpc HelloUser(HelloUserRequest) returns (HelloUserResponse) {
option (google.api.http) = {
get: "/v1/example/hello/{name}"
};
}
}
message HelloWorldRequest {}
message HelloWorldResponse {
string greeting = 1;
}
message HelloUserRequest {
string name = 1;
}
message HelloUserResponse {
string greeting = 1;
}