CRUD operations in Gorilla mux

polaris · · 744 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Hello all, First of all, I am very new to Golang. I am trying to create RESTful API using Gorilla/mux and am successful in GET method. I wonder how to handle POST, PUT and DELETE methods effectively? Any hints and thoughts.</p> <hr/>**评论:**<br/><br/>muffinz0: <pre><p>Have a look at this: <a href="https://github.com/kelseyhightower/ipxed/blob/master/api/server.go">https://github.com/kelseyhightower/ipxed/blob/master/api/server.go</a></p></pre>param_at_ma: <pre><p>Thank you very much :)</p></pre>throwawayerlinker: <pre><p><a href="https://github.com/PatelNDipen/Answer-Patch">Here is my rest api</a>, I define the routers in the router directory (duh), assign the router to a handlers in both the api and app directory, and the controllers send a db dependency to the datastore directory for crud operations. The rest api is by no means complete, although it can still serve as an example.</p></pre>param_at_ma: <pre><p>Thank you very much :)</p></pre>

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

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