starwing / lua-protobuf

A Lua module to work with Google protobuf
MIT License
1.75k stars 387 forks source link

Could you deal custom options #88

Closed SheepQi closed 5 years ago

SheepQi commented 5 years ago

When I defining a message like this:

import "google/protobuf/descriptor.proto";

extend google.protobuf.MessageOptions {
  optional string my_option = 51234;
}

message MyMessage {
  option (my_option) = "Hello world!";
}

I have no way to get my_option's value. Thank you!

starwing commented 5 years ago

you should load descriptor.proto from Google and decode your pb file as google.protobuf.DescriptorFileSet and get options.