Would you use a framework for this?

agolangf · · 388 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<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&#39;s quite heavy, with it communicating with Databases, other API&#39;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&#39;s quite heavy, with it communicating with Databases, other API&#39;s and other servers.</p> </blockquote> <p>Code smart, an API won&#39;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&#39;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&#39;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&#39;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&#39;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&#39;ll do a shameless plug of my own framework/boilerplate <a href="http://github.com/bnkamalesh/webgo" rel="nofollow">WebGo</a>. It&#39;s a <em>configuration over convention</em> kind of framework, so might be useful for you.</p> <p>P.S: If it&#39;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

388 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传