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.
26 lines
689 B
26 lines
689 B
4 years ago
|
#
|
||
|
# Provide tests for having messages nested 3 levels deep
|
||
|
#
|
||
|
|
||
|
require 'google/protobuf'
|
||
|
|
||
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
||
|
add_file("function_call.proto", :syntax => :proto3) do
|
||
|
add_message "Function" do
|
||
|
optional :name, :string, 1
|
||
|
repeated :parameters, :message, 2, "Function.Parameter"
|
||
|
optional :return_type, :string, 3
|
||
|
end
|
||
|
add_message "Function.Parameter" do
|
||
|
optional :name, :string, 1
|
||
|
optional :value, :message, 2, "Function.Parameter.Value"
|
||
|
end
|
||
|
add_message "Function.Parameter.Value" do
|
||
|
oneof :type do
|
||
|
optional :string, :string, 1
|
||
|
optional :integer, :int64, 2
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|