Hi all,
I've been working with go-micro microservices framework, at which the core is a .proto file. Which is fantastic, works perfectly. But I find I'm generating code from my .proto files which are almost identical to my database models, so my ambition is to use those generated pb structs as my database models. For instance, say Mongodb. However I can't because there are some inconsistencies in types. Such as protobuf generated id's are `id string` and mgo models are `ID bsonObjectId`. I've found a custom plugin to add custom tags, but I can't find a plugin to add custom types, such as bson.ObjectId`.
So I can either carry on doing what I'm doing currently, which is writing hundrends of lines of inefficient code containing various loops etc in order to convert those inconsistencies. Or write some kind of plug-in in order to generate the additional pieces of code and types I'd need to have a complete database model.
Trouble is, I can't find any decent resources or examples on how to write a go based plugin for protoc. So I just wondered if anyone had any dead basic examples or tutorials, or any advice on the problem itself.
Thanks in advance!
Ewan Valentine