<p>YAM is our first Go project we thought others might find useful. </p>
<p>It's http serve mux which will hopefully make it easy to define routes and handlers for your http applications.</p>
<p>It's features include:</p>
<ul>
<li>405 handling</li>
<li>Easy sub routing</li>
<li>Simple pattern matching (pat style)</li>
<li>Configurable if you don't like default implementations</li>
<li>Doesn't break net/http convention</li>
</ul>
<p>Keen to see what you guys think and feedbacks always welcome :)</p>
<p><a href="https://github.com/thisissoon/yam" rel="nofollow">https://github.com/thisissoon/yam</a></p>
<p><a href="https://godoc.org/github.com/thisissoon/yam" rel="nofollow">https://godoc.org/github.com/thisissoon/yam</a></p>
<hr/>**评论:**<br/><br/>lantins: <pre><p>I've had a look, but I'm not seeing anything that 'sells me' on why I should try using YAM vs. another mux? Could you let us know what YOU think the main reason is? :)</p></pre>krak3n_: <pre><p>We build a lot of REST APIs @ SOON_ and we have been tinkering with Go here and there and decided to try and use it for one of our smaller services for an upcoming project.</p>
<p>We didn't want to go with a full blown Web framework, that would be like using a nuke to hit a pin head so we had a look around for some mux's that would give us the routing requirements we needed. We evaluated a few:</p>
<p>Gorilla Mux
Pat
Routes</p>
<p>All of which are nice projects but didn't give us what we wanted.</p>
<p>In gorilla mux out of the box there is no 405 handling (<a href="https://github.com/gorilla/mux/issues/6" rel="nofollow">https://github.com/gorilla/mux/issues/6</a>), it 404's, which might be fine for some. Sub Routing in Gorilla is also a bit of a pain, mostly due to this issue: <a href="https://github.com/gorilla/mux/issues/31" rel="nofollow">https://github.com/gorilla/mux/issues/31</a>.</p>
<p>Pat and Routes are great (and YAM is inspired by them) but don't (as far as I could see) provide sub routing so you can break up your routes into sensible packages to nicely modularise and organise your code.</p>
<p>So for those reasons above we decided to write YAM to fix those problems and give us a mux that has a simple API but flexible enough to not enforce convention onto the developer.</p>
<p>The godocs has a few examples but maybe I should update the readme with some nice cool examples and maybe even provide some example apps.</p>
<p>Edit: Spelling / Grammer</p></pre>lantins: <pre><p>Thank you! :)</p></pre>robvdl: <pre><p>hmm, a bit unrelated, I was going to say that icon doesn't look like a YAM, that's a Kumara! (in NZ it is anyway) However it turns out that New Zealand yams are different (I didn't know this). Googling "yam" vs "yam nz" has different images.</p></pre>krak3n_: <pre><p>ha, happy to change it for an image that more accurately resembles a yam :)</p></pre>robvdl: <pre><p>There's no need the image looks great. in NZ we just have a different kind of YAMs, they are very nice fried in butter or oil, or some people bake them, or have them with a roast :)</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传