GraphQL Docker API written in golang

polaris · · 525 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>On my learning process of GraphQL, i was looking for a use-case to get started, so I decided to write a wrapper in Golang for the Docker API.</p> <p>Then I found myself learning two things at once, GraphQL and the Docker API, pretty exciting though.</p> <p>So here&#39;s the project in case someone wants to give it a try, it&#39;s not fully implemented. Query-ready fields can be found in the description, on the TODO list. Of course it is available as a docker image as well :) </p> <p>Project: <a href="https://github.com/klud1/graphql-docker-api">https://github.com/klud1/graphql-docker-api</a></p> <hr/>**评论:**<br/><br/>daenney: <pre><p>Thank you so much for this! I&#39;ve been toying with GraphQL myself but the lack of good resources for Go has hampered my progress in the area. It&#39;s great to be able to read someone else&#39;s code, get a sense for how they structured things, defining the schema and queries etc.</p></pre>SeerUD: <pre><p>I recently did some performance testing with the particular library for GraphQL being used here, and it&#39;s actually less performant than the Node.js version, and the code ends up being littered with <code>interface{}</code>. I recently tried the same thing with <a href="https://github.com/neelance/graphql-go">this library</a>, and found the code to be far more idiomatic, without <code>interface{}</code>, and it was a <em>lot</em> faster too.</p> <p>It does seem however that the none of the Go implementations are mature, and none of them are well documented. The Node.js one in particular is excellent in this regard, which is unfortunate. I&#39;d like to see more people use GraphQL with go, and help push the libraries forward however, and that&#39;s also what I intend to do once I get started on something a bit meatier...</p></pre>Rhelza: <pre><p>this is insteresting to read, i should take a look to that one, didnt know about it...yeah the <code>interface{}</code> thingy ends up being kinda exhausting :/ </p></pre>kromem: <pre><p>The neelance library is really easy to implement, but lacking in documentation.</p> <p>But if you read the code in the &#34;example&#34; directory, it&#39;s not hard to figure out.</p></pre>daenney: <pre><p>Thanks for this, I&#39;ll definetly take a look. One of my issues was indeed the whole &#34;everything goes through <code>interface{}</code>&#34;, which just doesn&#39;t sit right with me. You lose many benefits of the language and tooling around it because of it, and it usually detrimental to performance too.</p></pre>Rhelza: <pre><p>Been playing with neelance library, it&#39;s pretty straightforward...i&#39;ll use that library for the project, here are the changes <a href="https://github.com/klud1/graphql-docker-api/tree/migrate-lib" rel="nofollow">https://github.com/klud1/graphql-docker-api/tree/migrate-lib</a></p></pre>Rhelza: <pre><p>Glad it helps, though i&#39;m far from being an expert at any of the fields covered in the project, i&#39;m doing my best to make things work, help would be highly appreciated <sup>_^</sup></p></pre>

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

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