-
-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support codegen off the structs after the protocol buffer gen has occured #56
Comments
Hi @joeblew99 and thank you for your feedback, Can you confirm that you are looking for a (or, the best) way to chain multiple generation tools, i.e.,
I'm pretty sure you already can chain |
Hey @moul yes please if you can make an example in the Chat demo with NATS.
I am emailing you a document outlining what i am building. Its quite a big 2 or 3 page document and easier to send to you with the images. I would like to get your feedback and also see if its something you would want added to this repo or i do it elsewhere. It extends from what you have. I am going to try to extend the CHAT example to support catchup when the client is offline. |
@moul thanks for adding this. Now i can get busy on codegen of the lower and upper layers. Which leads me to this - Have you seen this ? I am working on generating a strong typed DAL to BoltDB, and so i need to add a ton of meta data to the protobuf to hint what the data access layer codegen needs to do. what do ya think ? |
Currently the protobufs are used to code gen from, which is a awesome because that gets us our Types and the Transport and bindng sorted out.
But there are other things like DBs and Action Commands that can then also use code gen. We can codegen off the structs that the protobuf code gen made for us !
Its all based on this, which is nice and simple.
https://github.com/moul/protoc-gen-gotemplate
example:
Stellar uses it for a very large project.
There are 3 points where they gen from shown here:
https://github.com/stellar/horizon/search?utf8=%E2%9C%93&q=go+generate&type=
Here is one of the layers in the architecture where all Command Actions are generated from:
https://github.com/stellar/horizon/blob/master/src/github.com/stellar/horizon/main.go
From that generate command, it looks at all the action commands. Here is just one:
https://github.com/stellar/horizon/blob/master/src/github.com/stellar/horizon/actions_account.go
Wondering if this help. I think it has some merit
The text was updated successfully, but these errors were encountered: