Designing a simple agent software.

polaris · · 490 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I went through gobyexample and would like put the knowledge to good use. However, I don&#39;t even know where to start /=. Anyways, i&#39;m going to further breaker down the project into smaller pieces and hope this sub can give me pointers along the way.</p> <p>There will be two part of the software. The agent and the server. For now I just want to have a simple connection between them through a specific port. I want it to be fast and secure(hence my choice of golang).</p> <p>So where do I even start? For security do use the .key and .pub method? or there are some well known library in golang that&#39;s specifically design for this? </p> <p>Any guide out there on how to write a server/agent in golang? I&#39;m really beginner in this. I&#39;m a system admin but I have no knowledge in writing system software at all.</p> <hr/>**评论:**<br/><br/>yuhatemews: <pre><p>Hate to be that guy, and maybe I&#39;m just old and this is what passes for a systems administrator these days. How do you have no knowledge writing system software being a sys admin? </p> <p>Well that rant out of the way I&#39;m glad you are getting your feet wet and looking to expand your skill set that will without a doubt make your life better and increase the value and opportunities within your organization.</p> <p>I would suggest reading thru the excellent go primers on the net. Here is some explicit suggestions.</p> <p><a href="https://gobyexample.com" rel="nofollow">https://gobyexample.com</a> <a href="https://golang.org/doc/articles/wiki" rel="nofollow">https://golang.org/doc/articles/wiki</a> <a href="https://dave.cheney.net" rel="nofollow">https://dave.cheney.net</a> <a href="https://golang.org/doc/effective_go.html" rel="nofollow">https://golang.org/doc/effective_go.html</a> <a href="https://tour.golang.org/welcome/1" rel="nofollow">https://tour.golang.org/welcome/1</a></p> <p>Good gophering and have fun!</p></pre>juniorsysadmin1: <pre><p>I mean, I read,package, edit one here and there but never wrote one from ground up.</p></pre>celebratednut: <pre><p>There are Two basic client-server connection options, the first being http connections (website) the other being sockets. You mention specific port so Im guessing you want socket connections.</p> <p>You also mention security, on sockets the key/pub method is called TLS. This is NOT the place to start, it is the place to END the basic concept before you start adding features. </p> <p>To start look at <a href="https://golang.org/pkg/" rel="nofollow">golang packages</a>. I suggest only starting out with Go vanilla packages to get used to the way Go does things. </p> <p>I also think that starting with domain sockets may be a little too big of a challenge to start with, first try building a couple input/output functions. then when youre ready you can redirect them into sockets.</p> <p>If you&#39;re dead set on starting with sockets then look at <a href="https://golang.org/pkg/net/" rel="nofollow">golang net package</a></p></pre>hnyakwai: <pre><p>So, if yoy really want simple, just read the godoc for the net package. Specifically the net.Listener example shows a basic socket server. </p> <p>However, this will not be secure. Then you need to wrap the connection with TLS, and figure out how certificates should work.</p> <p>Then you are going to have to figure out what you want your protocol to look like, how you are going to serialize data, how to handle broken connections, etc.</p> <p>If you actually want to get something done that will work and be secure, save yourself the trouble and use GRPC. If you just want to learn, start with reading the &#34;net&#34; godoc and work your way down the rabbit hole from there.</p></pre>anoland: <pre><p>There is a lot of good info in this talk.</p> <p><a href="https://m.youtube.com/watch?v=MeOK1UzGHYw" rel="nofollow">https://m.youtube.com/watch?v=MeOK1UzGHYw</a></p></pre>

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

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