Protocol Buffers - Google's data interchange format (grpc依赖)
https://developers.google.com/protocol-buffers/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.1 KiB
52 lines
1.1 KiB
syntax = "proto3"; |
|
|
|
package service_test_protos; |
|
|
|
import "google/protobuf/descriptor.proto"; |
|
|
|
message UnaryRequestType { |
|
string ping = 1; |
|
} |
|
|
|
message UnaryResponseType { |
|
string pong = 1; |
|
} |
|
|
|
message StreamRequestType { |
|
string ping = 1; |
|
uint32 sequence = 2; |
|
} |
|
|
|
message StreamResponseType { |
|
string pong = 1; |
|
uint32 sequence = 2; |
|
} |
|
|
|
message TestOptionsType { |
|
uint32 int_option_value = 1; |
|
} |
|
|
|
extend google.protobuf.ServiceOptions { |
|
optional TestOptionsType test_options = 50000; |
|
} |
|
|
|
service TestService { |
|
option (test_options).int_option_value = 8325; |
|
|
|
rpc UnaryOne(UnaryRequestType) returns (UnaryResponseType); |
|
rpc UnaryTwo(UnaryRequestType) returns (UnaryResponseType); |
|
|
|
rpc IdempotentMethod(UnaryRequestType) returns (UnaryResponseType) { |
|
option idempotency_level = IDEMPOTENT; |
|
} |
|
rpc PureMethod(UnaryRequestType) returns (UnaryResponseType) { |
|
option idempotency_level = NO_SIDE_EFFECTS; |
|
} |
|
|
|
rpc StreamingMethod(stream StreamRequestType) |
|
returns (stream StreamResponseType); |
|
} |
|
|
|
service DeprecatedService { |
|
option deprecated = true; |
|
}
|
|
|