<p>Hi</p>
<p>TL;DR</p>
<p>This is a project which should help you get things done faster. Here is documentation <a href="https://nildev.gitbooks.io/nildev/content/index.html" rel="nofollow">https://nildev.gitbooks.io/nildev/content/index.html</a>.</p>
<p>Long story</p>
<p>Whenever you start working on REST API first thing you do is you start from setting up whole infrastructure, wiring code like routing, middleware, configs and so on. Some devs like frameworks, some prefer libs, some go their own way and just does copy/paste from their template. But I believe that vast majority will agree that time you spent on these tasks feels like waste of time. That's one. </p>
<p>Another challenge you get in to is "which framework, library should I use for tasks mentioned above". I was going through reddit and forums and at least i got an impression that if there would be an option not to use any 3rd party framework, lib devs would do that. Using plain <code>net/http</code> is what a lot of us prefer. This applies to other packages as well. I think reason for that is that frameworks comes and goes, new emerges, old get's forgotten and we are left with challenges how to switch to new "better" ones. I thinks it's unfair. We should be able not to worry about this. </p>
<p>So how nildev tries to solve it ? Well idea is that all infrastructure code should be "swappable". Today I use "Martini" and tomorrow I want to change it to something else. My approach here is code generation and predefined "flavoured" API host containers (not docker container in this context). For example I have this <a href="https://github.com/nildev/api-host" rel="nofollow">https://github.com/nildev/api-host</a> container which uses gorilla libs. But if I would find more attractive lib I would create another one and then using nildev would generate glue code to merge my endpoint, which encapsulates logic, with this new container. <a href="https://github.com/nildev/auth" rel="nofollow">https://github.com/nildev/auth</a> is sample service build with nildev. </p>
<p>Ideally the only code I want to write and worry about is the one that is specific to my endpoint. The rest should require as minimal time investment as possible.</p>
<p>In this <a href="https://nildev.gitbooks.io/nildev/content/index.html" rel="nofollow">https://nildev.gitbooks.io/nildev/content/index.html</a> i've tried to document my approach and explain how in current prototype it works. Here <a href="https://github.com/nildev" rel="nofollow">https://github.com/nildev</a> you can find sub projects.</p>
<p>I used this for couple of my own small projects and was satisfied with it (what a surprise :)). But now I want to share it with others and get some opinions and well-argumented critique. Does this make any sense or it's total BS.</p>
<p>Thanks!</p>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传