<p>So i have to build an API in Go and was wondering if i should use a framework. If it was any other language i would use a framework but from my knowledge of Go and what other people seem to think it maybe best to go framework free. In terms of endpoints the API is fairly small (only 3-4) but in terms of logic for each endpoint it's quite heavy, with it communicating with Databases, other API's and other servers.</p>
<p>What do you guys think would be the best option in this case?</p>
<hr/>**评论:**<br/><br/>FrenchDonkey: <pre><p>basic net/http is good enough and for 3/4 endpoints you should not need more.</p>
<blockquote>
<p>terms of logic for each endpoint it's quite heavy, with it communicating with Databases, other API's and other servers.</p>
</blockquote>
<p>Code smart, an API won't help</p></pre>rvxt: <pre><p>stick to the simplest possible solution.</p>
<p>start by analyzing what you need. now look to see if net/http does it. Only If it doesn't (eg, lots of middleware with context passing is needed) then go for a framework.</p></pre>RevMen: <pre><p>The Gorilla tools are pretty handy, but you won't need or want anything more than that, based on my experience.</p></pre>tclineks: <pre><p>Just write it and see.</p></pre>bketelsen: <pre><p>take a look at <a href="http://goa.design" rel="nofollow">http://goa.design</a></p></pre>sh4rk1z: <pre><p>Framework free is the way if you don't have too many endpoints but I would also take a look at:
<a href="https://github.com/valyala/fasthttp" rel="nofollow">https://github.com/valyala/fasthttp</a></p></pre>yajiya: <pre><p>It's up to you.
For me, I like simple, clean, high productive, and high performance choice. And I am using Echo now.
Maybe a little heavy for API. </p></pre>kamaleshbn: <pre><p>I'll do a shameless plug of my own framework/boilerplate <a href="http://github.com/bnkamalesh/webgo" rel="nofollow">WebGo</a>. It's a <em>configuration over convention</em> kind of framework, so might be useful for you.</p>
<p>P.S: If it's just 3-4 APIs <em>and not planning to increase that any time soon</em>, you could just go framework free.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传