echo? or which framework should I use

polaris · · 1213 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>as titled, I am planning to build a RESTful API server with mongodb, and saw echo (<a href="https://github.com/labstack/echo" rel="nofollow">https://github.com/labstack/echo</a>) has great performance. question is really how good is the framework to play with mongo and is it well-maintained?</p> <p>or any other suggestions?</p> <p>Cheers.</p> <hr/>**评论:**<br/><br/>skarlso: <pre><p>I&#39;m using <a href="https://github.com/gin-gonic/gin" rel="nofollow">Gin</a>, and I&#39;m very happy with it. Performance is awesome. Logging, error handling, middleware is awesome, and basically anything what you would need, like logging and panic handling, is already in it. It&#39;s a breeze to setup, and it basically takes care of all the JSON parsing between requests and responses. And it&#39;s still small enough to be not in your way; also groupping API versions is f*king gorgeous. And compared to echo, it is much more mature.&lt;/opinion&gt;</p></pre>skidooer: <pre><blockquote> <p>or any other suggestions?</p> </blockquote> <p><a href="https://golang.org/pkg/net/http/" rel="nofollow">net/http</a></p> <p>Especially if you don&#39;t already know exactly what you plan to gain from using a given framework.</p></pre>mgutz: <pre><p>I see a lot of people recommend Gin. Gin&#39;s router is finicky and often have to resort to unintuitive paths. We moved to echo because of it.</p></pre>ecmdome: <pre><p>It all depends on your comfort and knowledge of what goes into a framework.</p> <p>Go is very modular which allows you to kind of piece together tour own framework.</p> <p>Some of my favorite packages to help this task along are <a href="https://github.com/codegangsta/negroni" rel="nofollow">Negroni</a> and various packages from the <a href="http://www.gorillatoolkit.org" rel="nofollow">Gorilla Toolkit</a>, primarily the mux and session packages </p> <p>edit: updated broken gorilla toolkit link</p></pre>dlsniper: <pre><p>Gorilla Toolkit for me as well.</p> <p>If you get to the point where performance of your router prevents your code from scaling then you should look into others.</p></pre>1Gijs: <pre><p>I hear Gin mentioned regularly by devs much more seasoned then me. I used Echo in my current project but plan to use Gin next.</p></pre>CaptaincCodeman: <pre><p>I&#39;ve tried a few frameworks and settled on echo. It&#39;s worked well and I&#39;ve had no problems with it. The performance is great and the devs are responsive to any issues or suggestions.</p> <p>Many of the micro-frameworks are fairly similar though and if you architect your solution well then it&#39;s fairly easy to switch between them - the framework really just handles routing plus parsing params / serializing responses. The guts of your app shouldn&#39;t really have to know too much about the web framework (or the persistence) so those things can be swapped out.</p></pre>ahmetlutfu: <pre><p>try beego. <a href="http://beego.me/docs/intro/" rel="nofollow">http://beego.me/docs/intro/</a></p></pre>genxstylez: <pre><p>What&#39;s rhe performance comparison between gin and echo?</p></pre>skarlso: <pre><p>It&#39;s right there on their github page. ;) With big letters saying: <strong>Performance</strong>. They are even underneath each other.</p> <pre><code>BenchmarkEcho_GithubAll 30000 38662 ns/op 0 B/op 0 allocs/op BenchmarkGin_GithubAll 30000 43467 ns/op 0 B/op 0 allocs/op </code></pre></pre>genxstylez: <pre><p>I know, but I just wana double check, haha.</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

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