-
Notifications
You must be signed in to change notification settings - Fork 3
/
service.proto
47 lines (39 loc) · 1.26 KB
/
service.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
syntax = "proto3";
package chief_of_state.v1;
option csharp_namespace = "Namely.ChiefOfState.V1";
option go_package = "chief_of_state/v1;chiefofstatev1";
option java_multiple_files = true;
option java_outer_classname = "CosServiceProto";
option java_package = "com.namely.protobuf.chiefofstate.v1";
import "chief_of_state/v1/common.proto";
import "google/protobuf/any.proto";
// Service definition
service ChiefOfStateService {
// Used to process command sent by an application
rpc ProcessCommand(ProcessCommandRequest) returns (ProcessCommandResponse);
// Used to get the current state of that entity
rpc GetState(GetStateRequest) returns (GetStateResponse);
}
// ProcessCommandRequest
message ProcessCommandRequest {
// the entity unique id
string entity_id = 1;
// the command to process
google.protobuf.Any command = 2;
}
// ProcessCommandResponse
message ProcessCommandResponse {
// the entity state returned after the command has been processed
google.protobuf.Any state = 1;
// additional meta data
chief_of_state.v1.MetaData meta = 2;
}
message GetStateRequest {
string entity_id = 1;
}
message GetStateResponse {
// the current state of the entity
google.protobuf.Any state = 1;
// additional meta data
chief_of_state.v1.MetaData meta = 2;
}