I need to simply load the contents of a few .proto files in https://pkg.go.dev/google.golang.org/protobuf/reflect/protoregistry
From what I can gather, I need to
- Load the contents of the file as a string.
- Use
prototext
to Unmarshal the string into adescriptorpb.FileDescriptorProto
- Initialize a
ProtoFileDescriptor
with that - Finally I can register the ProtoFileDescriptor in a registry.
Do I really need to jump through all of these hoops, or am I completely missing another API.
Aucun commentaire:
Enregistrer un commentaire