{"id":593,"date":"2017-03-07T23:48:02","date_gmt":"2017-03-07T15:48:02","guid":{"rendered":"https:\/\/carlos.aboutmy.info\/blog\/?p=593"},"modified":"2017-03-07T23:48:02","modified_gmt":"2017-03-07T15:48:02","slug":"%e7%94%a8-gorush-%e4%be%86%e8%ab%87%e8%ab%87-google-go","status":"publish","type":"post","link":"https:\/\/carlos.aboutmy.info\/blog\/?p=593","title":{"rendered":"\u7528 gorush \u4f86\u8ac7\u8ac7 Google Go"},"content":{"rendered":"<p>\u4e00\u76f4\u90fd\u597d\u60f3\u5beb\u4e00\u500b Push Notification \u7684 portal\/server\uff0c\u4f86\u63d0\u4f9b HTTP RESTFul API \u7d66\u9700\u8981 push notification \u7684 program\u3002\u9019\u6a23\u53ef\u4ee5\u96c6\u4e2d\u8655\u57cb push notification\uff0c\u5404 program \u4e0d\u7528\u91cd\u8986 push notification \u7684\u90e8\u4efd\uff0c\u4e0d\u7528 &#8220;reinventing the wheel&#8221;\u3002<\/p>\n<p>\u7d50\u679c\uff0c\u6211\u5728 GitHub \u9019\u500b\u5927\u5bf6\u85cf\u767c\u73fe\u4e86\u500b <a href=\"https:\/\/github.com\/appleboy\/gorush\">grouch<\/a>\uff01<\/p>\n<p><code>gorush<\/code>\u652f\u63f4 iOS \u53ca Android \u7684 push notification\uff0c\u53ef\u4ee5\u7528 command line \u5feb\u901f\u6e2c\u8a66\uff0c\u4e5f\u53ef\u4ee5\u7528 server mode \u9577\u99d0\u3002\u5b83\u672c\u8eab\u5e36\u6709 portal \u53ca stat API\uff0c\u7528\u4f86\u67e5\u770b server \u53ca push \u72c0\u614b\uff0c\u53ef\u8b02\u4e00\u61c9\u4ff1\u5168\u3002\u5b83\u7528 GO \u5beb\u6210\uff0c\u9019\u500b\u662f\u5b83\u7684\u4e00\u5927\u597d\u8655\u3002\u4f55\u89e3\uff1f\u90a3\u5c31\u8ac7\u8ac7 GO\u3002<\/p>\n<p>GO \u662f Google \u7684\u7522\u54c1\uff0c\u5b83\u7684\u6b77\u53f2\u53ef\u4ee5\u81ea\u884c Google\u3002\u6211\u7b2c\u4e00\u6b21\u5beb GO \u5927\u7d04\u662f 2010 \u5e74\u7684\u4e8b\uff0c\u8fd1\u5e74 GO \u958b\u59cb\u5ee3\u6cdb\u4f7f\u7528\uff0c\u6700\u8457\u540d\u8981\u7b97\u5f97\u4e0a\u662f <a href=\"https:\/\/www.docker.com\/\">Docker<\/a>\u3002<\/p>\n<p>GO \u662f strong type \u53ca compiled \u8a9e\u8a00\uff0c\u7531\u65bc compile \u6210 native machine code\uff0c\u6548\u80fd\u63a5\u8fd1 C\/C++\uff0c\u800c compile \u51fa\u4f86\u7684 binary \u662f\u4ee5 static linking\u3002Compile \u51fa\u4f86\u7684 binary\u300c\u5f88\u5927\u300d\uff0c\u4ee5 Linux x64 gorush \u70ba\u4f8b\u5b50\uff0c\u5c31\u6709 9.7MB\uff0c\u4f46\u7d55\u5c0d\u503c\u5f97\uff0c\u56e0\u70ba\u4f60\u53ea\u9700\u628a gorush \u9019\u500b\u55ae\u4e00\u57f7\u884c\u6a94\u653e\u5230 server \u4fbf\u53ef\u904b\u884c\u3002\u7531\u65bc\u6c92\u6709\u4f9d\u8cf4\u5eab (library dependencies)\uff0c\u4e0d\u8ad6\u653e\u5230 Ubuntu\u3001CentOS\u3001Fedora\u3001Debian \u6216\u5176\u4ed6 Linux \u90fd\u53ef\u4ee5\u4e00\u6a94\u8d70\u5929\u4e0b\u3002<\/p>\n<p>\u8a2d\u5b9a\u597d\u500b YAML config\uff0cgorush \u4fbf\u53ef\u4ee5 server mode \u9577\u99d0\u904b\u884c\uff0c\u5176\u4ed6 programs \u53ea\u9700\u4ee5 HTTP POST JSON payload \u4fbf\u53ef\u505a\u5230 push notification\uff0c\u975e\u5e38\u7c21\u55ae\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u76f4\u90fd\u597d\u60f3\u5beb\u4e00\u500b Push Notification \u7684 portal\/server\uff0c\u4f86\u63d0\u4f9b HTTP RESTFul API \u7d66\u9700\u8981 push notification \u7684 program\u3002\u9019\u6a23\u53ef\u4ee5\u96c6\u4e2d\u8655\u57cb push notification\uff0c\u5404 program \u4e0d\u7528\u91cd\u8986 push notification \u7684\u90e8\u4efd\uff0c\u4e0d\u7528 &#8220;reinventing the wheel&#8221;\u3002 \u7d50\u679c\uff0c\u6211\u5728 GitHub \u9019\u500b\u5927\u5bf6\u85cf\u767c\u73fe\u4e86\u500b grouch\uff01 gorush\u652f\u63f4 iOS \u53ca Android \u7684 push notification\uff0c\u53ef\u4ee5\u7528 command line \u5feb\u901f\u6e2c\u8a66\uff0c\u4e5f\u53ef\u4ee5\u7528 server mode \u9577\u99d0\u3002\u5b83\u672c\u8eab\u5e36\u6709 portal \u53ca stat API\uff0c\u7528\u4f86\u67e5\u770b server \u53ca push \u72c0\u614b\uff0c\u53ef\u8b02\u4e00\u61c9\u4ff1\u5168\u3002\u5b83\u7528 GO \u5beb\u6210\uff0c\u9019\u500b\u662f\u5b83\u7684\u4e00\u5927\u597d\u8655\u3002\u4f55\u89e3\uff1f\u90a3\u5c31\u8ac7\u8ac7 GO\u3002 GO \u662f Google \u7684\u7522\u54c1\uff0c\u5b83\u7684\u6b77\u53f2\u53ef\u4ee5\u81ea\u884c\u2026 <span class=\"read-more\"><a href=\"https:\/\/carlos.aboutmy.info\/blog\/?p=593\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,15],"tags":[],"_links":{"self":[{"href":"https:\/\/carlos.aboutmy.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/593"}],"collection":[{"href":"https:\/\/carlos.aboutmy.info\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/carlos.aboutmy.info\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/carlos.aboutmy.info\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/carlos.aboutmy.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=593"}],"version-history":[{"count":1,"href":"https:\/\/carlos.aboutmy.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/593\/revisions"}],"predecessor-version":[{"id":594,"href":"https:\/\/carlos.aboutmy.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/593\/revisions\/594"}],"wp:attachment":[{"href":"https:\/\/carlos.aboutmy.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=593"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/carlos.aboutmy.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=593"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/carlos.aboutmy.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=593"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}