-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Automatically generate the boilerplate #70
Comments
I also have some WIP here similar to @sasha-s, I'll try to push it this weekend, we can maybe mix aproach |
go automatically generate code can reference goagen of goa |
Have you considering add predefined or default response for new endpoint? It maybe help for mock service during develop new API. |
👍 I consider the verbosity the only flaw of gokit. It complicates the code and hides important implementation details. It also increases the learning curve. |
@peterbourgon in #75 you mention that you'd welcome a fresh try at accomplishing this. Do you have thoughts on how that attempt went wrong, and how it could be tried again? I was looking to try out go-kit, and this exact issue is what's making me hesitate. If the generation is straightforward enough, maybe it's the sort of thing that myself or another interested beginner could attempt. |
@kofalt I would absolutely welcome fresh eyes on this. In truth I think it would not be too hard: it would be a great project for someone who wants to get nice and cozy with package go/ast. I've updated the initial issue with some changes, please take a look! If you want to get serious, I'd love to chat more; you can find me on the Gophers Slack in |
@kujtimiihoxha has created https://github.com/kujtimiihoxha/gk which seems to be a fairly good approximation of my "spec" above. I haven't had a chance to play with it in earnest yet but I shall! |
Tune has also been working on something kind of like this. It is called |
You can also check out my new generator https://github.com/kujtimiihoxha/kit 🎉 |
for people landing on this ticket, you should also look at: https://github.com/go-kit/kit/tree/master/cmd/kitgen from #589 |
Given a service interface definition
It should be possible to automatically generate a stub service implementation, request and response types, endpoint factories, an endpoints struct, and transport bindings.
The CLI should have a UX like
The default repo layout should look like addsvc in the go-microservices repo; the flat repo layout should put all files and types in the same package. Other layout options could be considered.
The text was updated successfully, but these errors were encountered: