<p>Hey, I'm a newbie to go (though it's super easy to pick up!) and am working on a simple web app with Revel to manage a number of servers.</p>
<p>I've got my code working great on my single system, but I'm not sure what 'best practice' would be to start talking across the network to other boxes where I need to get information and run various commands.</p>
<p>You could think of it as the same way as ssh-ing into various servers, getting data about it, and taking whatever actions in the shell.</p>
<p>Anyway, I GUESS I could use "os/exec" but that seems hacky when I should be able to set up something a bit better.</p>
<p>Thanks in advance for your thoughts on this!</p>
<hr/>**评论:**<br/><br/>ask: <pre><p>The question is a little like "what kind of engine should I use?" without information about the application -- Car? Race car? Truck? Bike? Airplane? How big?</p>
<p>A typical simple solution would be exposing the functions you need as HTTP APIs and use those. Depending on your requirements you can make it ever more complicated with an external queue or messaging system, etc etc.</p>
<p>A good place to start is just an HTTP/JSON API.</p></pre>rco8786: <pre><p>This is only semi-sarcastic, and I might get the downvotes, but you should read everything here: <a href="https://dancres.github.io/Pages/" rel="nofollow">https://dancres.github.io/Pages/</a></p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传