IMGART Project

agolangf · · 434 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>During my journey learning GO I found the following questions several times: &#34;How do I struct GO applications?&#34;, &#34;There is any good project as example?”. </p> <p>Well, I also made this question! Every example that I found they just simply put everything in the same package... So I decided to create IMGART project as an example of a real application.</p> <p>IMGART consists is a HTTP Service for image processing based on filters and profiles: <a href="https://github.com/talento90/imgart">https://github.com/talento90/imgart</a></p> <p>List of features that you can find in this project:</p> <ul> <li>HTTP API Middlewares (logging, serialization, error handling)</li> <li>Documentation using Swagger Specification</li> <li>Dockerfiles (Development and production)</li> <li>Multiple databases (Redis for image caching and MongoDB for profiles)</li> <li>Graceful Shutdown</li> <li>Healthcheck</li> <li>Debugging with Delve, VSCode and Docker</li> <li>Error Handling</li> <li>Make file</li> </ul> <p>I am thinking about creating a blog post serie explaining my decisions... What do you think?</p> <p>I would appreciate your feedback (negative/positive)</p> <p>Happy coding :)</p> <hr/>**评论:**<br/><br/>shovelpost: <pre><p>I think that we are talking about a very good package structure. My opinion is that if you remove the unnecessary <code>pkg</code> it will become even better.</p></pre>Talento90: <pre><p>I have thought about that a million times and I am still thinking about removing <code>pkg</code> folder, but at the same time I think it makes sense to separate the deliveries <code>cmd</code> folder from the application code! So I live in a mix feelings about this :)</p></pre>shovelpost: <pre><p>Using a <code>cmd</code> folder is a very common pattern in Go projects. By having a <code>cmd</code> folder you are already separating your commands from the application code. Therefore there&#39;s no need to do an extra separation.</p> <p>Having good package names (like yours) allows to very easily see the different concepts of the project as soon as you visit the code repository. But as it is now, they are all hidden behind the <code>pkg</code> folder.</p></pre>kostix: <pre><p>Pleas please please don&#39;t forget spill the &#34;web&#34; word all over your text when you&#39;re talking about web applications. Go is not about web only.</p></pre>megamark16: <pre><p>Last night I thought about brushing up on Go and literally googled four &#34;golang project structure best practices&#34;. So, yes, yes please!</p></pre>

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

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