{"id":267588,"date":"2015-11-05T22:06:03","date_gmt":"2015-11-05T19:06:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=267588"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=267588","title":{"rendered":"\u0413\u0438\u0431\u043a\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 Go"},"content":{"rendered":"<p>       \u041f\u0440\u0438\u0432\u0435\u0442. \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u044d\u0442\u043e \u0430\u0434\u0441\u043a\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u0430. \u0422\u0430\u043a \u0447\u0442\u043e \u043d\u0430 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0441\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u0445 \u0438 \u0440\u0438\u0441\u043a.<\/p>\n<p>  \u042f \u0434\u043e\u043b\u0433\u043e \u0438\u0441\u043a\u0430\u043b \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0434\u043b\u044f \u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u043e\u0432 \u043d\u0430 Go \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u043b\u0430 \u0431\u044b \u043c\u043e\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b (\u0433\u0438\u0431\u043a\u0430\u044f, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u0435\u043c\u0435\u0439\u043b, \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u0430\u044f \u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043b\u043e\u0433\u043e\u0432 \u0432 \u043c\u0443\u0441\u043a\u0443\u043b\u0435)<\/p>\n<p>  \u0421\u043a\u0430\u0436\u0443 \u0447\u0435\u0441\u0442\u043d\u043e \u0438\u0441\u043a\u0430\u043b \u044f \u0434\u043d\u044f \u0442\u0440\u0438 \u0442\u0430\u043a \u043d\u0435 \u0447\u0435\u0433\u043e \u0438 \u043d\u0435 \u043d\u0430\u0448\u0435\u043b. \u041f\u043e\u0442\u043e\u043c \u044f \u043d\u0430\u0447\u0430\u043b \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 (\u043f\u0435\u0440\u0432\u0430\u044f \u0435\u0433\u043e \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u044b\u043b\u0430 \u043e\u0447\u0435\u043d\u044c \u043a\u0440\u0438\u0432\u0430\u044f \u0438 \u0435\u043b\u0435 \u0435\u043b\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430). \u041f\u043e\u0442\u043e\u043c \u044f \u0443\u0434\u0430\u043b\u0438\u043b \u0432\u0435\u0441\u044c \u0442\u043e\u0442 \u043a\u043e\u0434 \u0438 \u043d\u0430\u0447\u0430\u043b <s>\u0434\u0443\u043c\u0430\u0442\u044c<\/s> \u043f\u0438\u0441\u0430\u0442\u044c \u0437\u0430\u043d\u043e\u0432\u043e. <\/p>\n<p>  \u042f \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u043d\u044f\u043b \u0447\u0442\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0431\u0434 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043e\u0447\u0435\u043d\u044c \u0443\u0442\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u043e. \u041f\u043e \u044d\u0442\u043e\u043c\u0443 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0442\u0430\u043a:<\/p>\n<p>  \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043b\u043e\u0433\u043e\u0432 \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u043b\u044e\u0447 \u0432 \u0440\u0435\u0434\u0438\u0441\u0435 \u043a\u0443\u0434\u0430 \u043f\u0438\u0448\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0442\u0430\u043a\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0414\u0430\u043d\u043d\u044b\u0435 \u0432 \u0440\u0435\u0434\u0438\u0441\u0435<\/b><\/p>\n<div class=\"spoiler_text\"><code> ('Debug','2015-11-05 20:12:37.700052989 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.700506704 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.700663127 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.700803651 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.700987999 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.701128513 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.701293643 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.701433496 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.701602372 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.701745287 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.701925988 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.702093499 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.702276867 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.702431455 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.702581625 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.702738953 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.702899007 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.703055622 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.703210768 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.70340691 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.703566623 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.7037252 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.703954549 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.704119435 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.704281902 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.704536707 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.704721061 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.704901908 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.705106033 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.705284342 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.705465074 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.705633484 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.705802108 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.705962381 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.706129288 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.706314702 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.706463092 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.706674268 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.706848586 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.707050005 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.707221136 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.707379335 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.707583978 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.707742422 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.707967253 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.708164671 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.708410554 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.708578324 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.708775197 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.708955609 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.709184168 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.709349784 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.709510939 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.709726286 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.709940253 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.710141611 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.71034329 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.710537637 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.710763157 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.710969449 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.711167704 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.711355522 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.711550562 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.711756 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.712048767 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.712273974 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.712517739 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.712828333 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.71306392 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.713335398 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.713570618 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.71389819 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.714182802 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.714448273 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.714754937 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.715018147 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.715291228 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.715596998 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.715910118 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.7162719 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.716552975 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.716807074 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.717153412 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.717434854 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.717704591 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.717991896 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.718283451 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.718590239 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.718849058 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.719152303 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.719424972 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.719734567 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.720070491 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.720386241 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.720651655 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.72094698 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.721207595 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.721514296 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.721776408 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.722090163 +0200 EET','Testing'), <\/code>  <\/div>\n<\/div>\n<p>  \u042f \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u0445\u043e\u0442\u0435\u043b \u0438\u0445 \u0432\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432 sql \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u043e \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0443 sql \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430. \u042f \u0434\u043e\u043b\u0433\u043e <s>\u0431\u0438\u043b\u0441\u044f \u0433\u043e\u043b\u043e\u0432 \u043e\u0431 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0443<\/s> \u0438\u0441\u043a\u0430\u043b \u0431\u0430\u0433\u0443 \u0432 \u043a\u043e\u0434\u0435, \u0430 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0447\u0442\u043e \u0438\u0437 \u2014 \u0437\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0440\u0435\u0434\u0438\u0441 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043c\u0430. \u041a\u043e\u0433\u0434\u0430 \u044f \u0435\u0451 \u0437\u0430\u043c\u0435\u0442\u0438\u043b \u044f <s>\u0434\u043e\u043b\u0433\u043e \u0433\u0443\u0433\u043b\u0438\u043b<\/s> \u0441\u043f\u0440\u043e\u0441\u0438\u043b \u043d\u0430 \u0442\u043e\u0441\u0442\u0435\u0440\u0435 \u043a\u0430\u043a \u0436\u0435 \u0443\u0431\u0440\u0430\u0442\u044c \u044d\u0442\u0443 \u043a\u043e\u043c\u0443. \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0449\u0435 \u043d\u0435\u043a\u0443\u0434\u0430   <\/p>\n<pre><code class=\"go\">strings.TrimRight(data, &quot;,&quot;) <\/code><\/pre>\n<p>  \u041f\u043e\u0442\u043e\u043c \u044f \u043d\u0430\u0447\u0430\u043b \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435. \u0421\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u044f \u043f\u043e\u043d\u044f\u043b <s>\u0447\u0442\u043e \u044f \u043e\u0441\u0451\u043b<\/s> \u0447\u0442\u043e \u044d\u0442\u043e \u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u043c\u043e\u0433\u0443 \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b\u043d\u0435\u0441 \u0435\u0451 \u0432 \u0434\u0435\u043c\u043e\u043d. <\/p>\n<p>  \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u044f \u0438\u043c\u0435\u044e <br \/>  \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 -&gt; \u043f\u0438\u0448\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0440\u0435\u0434\u0438\u0441. \u0412\u0441\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0430 \u0440\u0435\u0434\u0438\u0441<br \/>  \u0414\u0435\u043c\u043e\u043d -&gt; \u043e\u0434\u043d\u0438\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0432\u0441\u0435 \u043b\u043e\u0433\u0438 \u0441 \u0440\u0435\u0434\u0438\u0441\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u044e \u0432 mysql<\/p>\n<p>  \u041d\u0430 \u0441\u043b\u0430\u0431\u043e\u043c \u0432\u043f\u0441 (\u0447\u0430\u0441\u0442\u043e\u0442\u0430 1.6; 1\u044f\u0434\u0440\u043e, 2 \u0433\u0431 \u043e\u0437\u0443) 1 000 000 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 \u043c\u0443\u0441\u043a\u0443\u043b\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u043e\u0441\u044c \u0437\u0430 25\u043c\u043b.\u0441\u0435\u043a (\u0431\u0434 \u0431\u0435\u0437 \u0442\u044e\u043d\u0438\u043d\u0433\u0430) \u043f\u0440\u0430\u0432\u0434\u0430 \u0432 \u0440\u0435\u0434\u0438\u0441 \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0438\u0441\u0430\u043b\u0438\u0441\u044c \u043e\u043a\u043e\u043b\u043e 6 \u043c\u0438\u043d\u0443\u0442. \u0412\u0441\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0430 \u043d\u0430 \u0440\u0435\u0434\u0438\u0441\u0435. <\/p>\n<p>  \u0412\u043e\u0442 \u0432\u0440\u043e\u0434\u0435 \u0438 \u0432\u0441\u0451.   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u043a\u043e\u043d\u0444\u0438\u0433<\/b><\/p>\n<div class=\"spoiler_text\"><code> { \t \t&quot;MailConf&quot;  : [ \t\t&quot;\u043b\u043e\u0433\u0438\u043d \u043d\u0430 smtp \u0441\u0435\u0440\u0432\u0435\u0440\u0435&quot;,   \t\t&quot;\u043f\u0430\u0440\u043e\u043b\u044c&quot;,       \t\t&quot;smtp \u0441\u0435\u0440\u0432\u0435\u0440&quot;,  \t\t&quot;\u043f\u043e\u0440\u0442 smtp \u0441\u0435\u0440\u0432\u0435\u0440\u0430&quot; \t], \t \t&quot;MailTo&quot;    : [ \t\t&quot;\u043d\u0430_\u043a\u0430\u043a\u0438\u0435_\u0435\u043c\u0435\u0439\u043b\u044b_\u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c@gmail.com&quot;,     \t\t&quot;v.grabko99@yandex.ru&quot; \t], \t \t&quot;Types&quot;     : [ \t\t&quot;Debug&quot;, \t\t&quot;Info&quot;, \t\t&quot;Warn&quot;, \t\t&quot;Error&quot;, \t\t&quot;Fatal&quot; \t],  \t&quot;EmailSend&quot; : [ \t\t&quot;Error&quot;, \t\t&quot;Fatal&quot; \t],  \t&quot;Redis&quot; : [ \t\t&quot;localhost:6379&quot;, \t\t&quot;parsh888&quot;, \t\t&quot;log_&quot; \t],  \t&quot;MysqlConnect&quot; : [ \t\t&quot;\u044e\u0437\u0435\u0440&quot;, \t\t&quot;\u043f\u0430\u0440\u043e\u043b\u044c&quot;, \t\t&quot;\u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445&quot; \t],  \t&quot;MysqlTable&quot; : &quot;log&quot;, \t&quot;ReplicationTimeSecond&quot; : 320  } <\/code>  <\/div>\n<\/div>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"go\">package GeneralsLog  import ( \t&quot;encoding\/json&quot; \t&quot;gopkg.in\/redis.v3&quot; \t&quot;io\/ioutil&quot; \t&quot;log&quot; \t&quot;microService\/libs\/mail&quot; \t&quot;time&quot; )  type Config struct { \tMailTo, MailConf, Types, EmailSend, Redis, MysqlConnect []string \tMysqlTable                                              string }  var ( \tR           *redis.Client \tMailConf    map[string]string \tMailTo      []string \tTypes       []string \tEmailSend   []string \tRedisConfig []string  \t\/\/\u041f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0430\u043c\u0438 \tconfig_file string = &quot;\/home\/v-smerti\/localhost\/api\/src\/microService\/config\/log.json&quot; )  func init() {  \t\/\/\u0421\u043f\u0430\u0440\u0441\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433 \tbs, err := ioutil.ReadFile(config_file) \tif err != nil { \t\tlog.Panicln(err) \t}  \tb := []byte(bs) \tvar conf Config \terr = json.Unmarshal(b, &conf) \tif err != nil { \t\tlog.Panicln(err) \t} \t\/\/\u041f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433 \u0444\u0430\u0439\u043b\u0430 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \tMailConf = map[string]string{ \t\t&quot;username&quot;: conf.MailConf[0], \t\t&quot;password&quot;: conf.MailConf[1], \t\t&quot;host&quot;:     conf.MailConf[2], \t\t&quot;port&quot;:     conf.MailConf[3], \t}  \tMailTo = conf.MailTo \tTypes = conf.Types \tEmailSend = conf.EmailSend \tRedisConfig = conf.Redis  \t\/\/\u041a\u043e\u043d\u0435\u043a\u0442 \u0441 \u0440\u0435\u0434\u0438\u0441\u043e\u043c \tR = redis.NewClient(&redis.Options{ \t\tAddr:     RedisConfig[0], \t\tPassword: RedisConfig[1], \t\tDB:       0, \t}) \t\/\/\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u0430. \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043c \u0435\u0441\u0442\u044c \u043b\u0438 \u0432 \u0440\u0435\u0434\u0438\u0441\u0435 \u0442\u0430\u043a\u0438\u0435 \u0442\u0438\u043f\u044b \u043b\u043e\u0433\u043e\u0432. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442 \u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u043c \tfor _, typ := range Types { \t\t_, err := R.Get(RedisConfig[2] + typ).Result() \t\tif err == redis.Nil { \t\t\tif err := R.Set(RedisConfig[2]+typ, &quot; &quot;, 0).Err(); err != nil { \t\t\t\tmail.Send(MailConf, MailTo, &quot;Fatal error game&quot;, &quot;package GeneralsLog func Init____R.Set (\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0443\u0441\u0442\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0440\u0435\u0434\u0438\u0441 \u043a\u043b\u044e\u0447 &quot;+typ+&quot;)&quot;) \t\t\t} \t\t} else if err != nil { \t\t\tmail.Send(MailConf, MailTo, &quot;Fatal error game&quot;, &quot;package GeneralsLog func Init____R.Set (\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0437\u0430\u043f\u0438\u0441\u0438 &quot;+typ+&quot; \u0432 \u0440\u0435\u0434\u0438\u0441\u0435)&quot;) \t\t} \t} }  func New(types string, messages string) { \tfor _, typ := range Types { \t\tif typ == types { \t\t\tif data, err := R.Get(RedisConfig[2] + typ).Result(); err == nil {  \t\t\t\t\/\/\u041d\u0430\u0434\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0442\u0438\u043f\u0430 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u043d\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043d\u0430 e-mail \t\t\t\tfor _, b := range EmailSend { \t\t\t\t\t\/\/\u043d\u0430\u0434\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \t\t\t\t\tif b == typ { \t\t\t\t\t\tmail.Send(MailConf, MailTo, typ, messages) \t\t\t\t\t} \t\t\t\t}  \t\t\t\tdata = data + &quot;('&quot; + types + &quot;','&quot; + time.Now().String() + &quot;','&quot; + messages + &quot;'),&quot;  \t\t\t\tif err := R.Set(RedisConfig[2]+typ, data, 0).Err(); err != nil { \t\t\t\t\tmail.Send(MailConf, MailTo, &quot;Fatal error game&quot;, &quot;package GeneralsLog func &quot;+typ+&quot;____R.Set (\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0440\u0435\u0434\u0438\u0441\u0435)&quot;) \t\t\t\t} \t\t\t} else { \t\t\t\tmail.Send(MailConf, MailTo, &quot;Fatal error game&quot;, &quot;package GeneralsLog func &quot;+typ+&quot;____R.Get (\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0440\u0435\u0434\u0438\u0441\u0430)&quot;) \t\t\t} \t\t} else { \t\t} \t}  }  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0434\u0435\u043c\u043e\u043d<\/b><\/p>\n<div class=\"spoiler_text\">package main<\/p>\n<p>  import (<br \/>   \u00abdatabase\/sql\u00bb<br \/>   _ \u00abgithub.com\/go-sql-driver\/mysql\u00bb \/\/\u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043b\u044e\u0431\u0443\u044e sql \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445<br \/>   \u00abgopkg.in\/redis.v3\u00bb<br \/>   \u00ablog\u00bb<br \/>   \u00abmicroService\/libs\/mail\u00bb<br \/>   \u00abstrings\u00bb<br \/>   \u00abtime\u00bb<\/p>\n<p>  \u00abencoding\/json\u00bb<br \/>   \u00abio\/ioutil\u00bb<br \/>  )<\/p>\n<p>  type Config struct {<br \/>   MailTo, MailConf, Types, EmailSend, Redis, MysqlConnect []string<br \/>   MysqlTable string<br \/>   ReplicationTimeSecond time.Duration<br \/>  }<\/p>\n<p>  var (<br \/>   DB *sql.DB<br \/>   R *redis.Client<br \/>   MailConf map[string]string<br \/>   MailTo []string<br \/>   Types []string<br \/>   EmailSend []string<br \/>   RedisConfig []string<br \/>   MysqlTable string<br \/>   ReplicationSecond time.Duration<br \/>   \/\/\u041f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0430\u043c\u0438<br \/>   config_file string = &quot;\/home\/v-smerti\/localhost\/api\/src\/microService\/config\/log.json&quot;<br \/>  )<\/p>\n<p>  func init() {<br \/>   print(\u00abStarting&#8230;\u00bb)<br \/>   \/\/\u0421\u043f\u0430\u0440\u0441\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433<br \/>   bs, err := ioutil.ReadFile(config_file)<br \/>   if err != nil {<br \/>   log.Panicln(err)<br \/>   }<\/p>\n<p>  b := []byte(bs)<br \/>   var conf Config<br \/>   err = json.Unmarshal(b, &#038;conf)<br \/>   if err != nil {<br \/>   log.Panicln(err)<br \/>   }<br \/>   \/\/\u041f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433 \u0444\u0430\u0439\u043b\u0430 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435<br \/>   MailConf = map[string]string{<br \/>   \u00abusername\u00bb: conf.MailConf[0],<br \/>   \u00abpassword\u00bb: conf.MailConf[1],<br \/>   \u00abhost\u00bb: conf.MailConf[2],<br \/>   \u00abport\u00bb: conf.MailConf[3],<br \/>   }<\/p>\n<p>  MailTo = conf.MailTo<br \/>   Types = conf.Types<br \/>   EmailSend = conf.EmailSend<br \/>   RedisConfig = conf.Redis<br \/>   MysqlTable = conf.MysqlTable<br \/>   ReplicationSecond = conf.ReplicationTimeSecond<\/p>\n<p>  \/\/\u041a\u043e\u043d\u0435\u043a\u0442 \u0441 \u0440\u0435\u0434\u0438\u0441\u043e\u043c<br \/>   R = redis.NewClient(&#038;redis.Options{<br \/>   Addr: RedisConfig[0],<br \/>   Password: RedisConfig[1],<br \/>   DB: 0,<br \/>   })<\/p>\n<p>  \/\/\u043a\u043e\u043d\u0435\u043a\u0442 \u0441 \u0431\u0434<br \/>   db, err := sql.Open(\u00abmysql\u00bb, conf.MysqlConnect[0]+&quot;:&quot;+conf.MysqlConnect[1]+&quot;@\/&quot;+conf.MysqlConnect[2])<br \/>   if err != nil {<br \/>   log.Fatal(err)<br \/>   }<br \/>   DB = db<\/p>\n<p>  \/\/\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u0430. \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043c \u0435\u0441\u0442\u044c \u043b\u0438 \u0432 \u0440\u0435\u0434\u0438\u0441\u0435 \u0442\u0430\u043a\u0438\u0435 \u0442\u0438\u043f\u044b \u043b\u043e\u0433\u043e\u0432. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442 \u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u043c<br \/>   for _, typ := range Types {<br \/>   _, err := R.Get(RedisConfig[2] + typ).Result()<br \/>   if err == redis.Nil {<br \/>   if err := R.Set(RedisConfig[2]+typ, &quot; &quot;, 0).Err(); err != nil {<br \/>   mail.Send(MailConf, MailTo, \u00abFatal error game\u00bb, \u00abpackage GeneralsLog func Init____R.Set (\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0443\u0441\u0442\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0440\u0435\u0434\u0438\u0441 \u043a\u043b\u044e\u0447 \u201e+typ+\u201c)\u00bb)<br \/>   }<br \/>   } else if err != nil {<br \/>   mail.Send(MailConf, MailTo, \u00abFatal error game\u00bb, \u00abpackage GeneralsLog func Init____R.Set (\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0437\u0430\u043f\u0438\u0441\u0438 \u201e+typ+\u201c \u0432 \u0440\u0435\u0434\u0438\u0441\u0435)\u00bb)<br \/>   }<br \/>   }<br \/>   print(&quot; Ok!&quot;)<br \/>  }<\/p>\n<p>  func main() {<br \/>   for {<br \/>   replication_db()<br \/>   time.Sleep(time.Second * ReplicationSecond)<br \/>   }<br \/>  }<\/p>\n<p>  func replication_db() {<\/p>\n<p>  for _, typ := range Types {<br \/>   data, err := R.Get(RedisConfig[2] + typ).Result()<br \/>   if err == redis.Nil {<\/p>\n<p>  mail.Send(MailConf, MailTo, \u00abFatal error game\u00bb, \u00abpackage GeneralsLog func replication_db____R.Set (\u041d\u0435\u0442\u0443 \u0432 \u0440\u0435\u0434\u0438\u0441\u0435 \u201e+typ+\u201c)\u00bb)<br \/>   if err := R.Set(RedisConfig[2]+typ, &quot; &quot;, 0).Err(); err != nil {<br \/>   mail.Send(MailConf, MailTo, \u00abFatal error game\u00bb, \u00abpackage GeneralsLog func replication_db____R.Set (\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0443\u0441\u0442\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0440\u0435\u0434\u0438\u0441 \u043a\u043b\u044e\u0447 \u201e+typ+\u201c)\u00bb)<br \/>   }<br \/>   } else if err != nil {<br \/>   log.Fatal(err)<br \/>   mail.Send(MailConf, MailTo, \u00abFatal error game\u00bb, \u00abpackage GeneralsLog func replication_db____R.GET (\u0424\u0430\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0440\u0435\u0434\u0438\u0441\u0430)\u00bb)<\/p>\n<p>  } else {<br \/>   if data != &quot; &quot; {<br \/>   _, err := DB.Exec(\u00abINSERT INTO \u00bb + MysqlTable + &quot; (type,time,messages) VALUES&quot; + strings.TrimRight(data, &quot;,&quot;))<br \/>   if err != nil {<br \/>   log.Fatal(err)<br \/>   } else {<br \/>   log.Println(\u00abreplication\u00bb)<br \/>   }<br \/>   if err := R.Set(RedisConfig[2]+typ, &quot; &quot;, 0).Err(); err != nil {<br \/>   mail.Send(MailConf, MailTo, \u00abFatal error game\u00bb, \u00abpackage GeneralsLog func replication_db____R.Set (\u041e\u0447\u0438\u0441\u0442\u043a\u0430 \u0437\u0430\u043f\u0438\u0441\u0438\u0438 \u201e+typ+\u201c)\u00bb)<br \/>   }<br \/>   }<\/p>\n<p>  }<br \/>   }<br \/>  }  <\/div>\n<\/div>\n<p>  \u0412 \u043a\u043e\u0434\u0435 \u0435\u0449\u0451 \u0435\u0441\u0442\u044c \u0438\u043c\u043f\u043e\u0440\u0442 \u043f\u0430\u043a\u0435\u0442\u0430 mail.   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0430\u043a\u0435\u0442 mail<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"go\">package mail  import ( \t&quot;fmt&quot; \t&quot;net\/smtp&quot; )  func Send(conf map[string]string, to []string, subject string, msg string) error { \tauth := smtp.PlainAuth( \t\t&quot;&quot;, \t\tconf[&quot;username&quot;], \t\tconf[&quot;password&quot;], \t\tconf[&quot;host&quot;], \t) \taddress := fmt.Sprintf(&quot;%v:%v&quot;, conf[&quot;host&quot;], conf[&quot;port&quot;]) \tbody := []byte(&quot;Subject: &quot; + subject + &quot;\\r\\n\\r\\n&quot; + msg) \terr := smtp.SendMail( \t\taddress, \t\tauth, \t\tconf[&quot;username&quot;], \t\tto, \t\tbody, \t) \tif err != nil { \t\treturn err \t} \treturn nil } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <a name=\"habracut\"><\/a>               <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/270263\/\"> http:\/\/habrahabr.ru\/post\/270263\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u041f\u0440\u0438\u0432\u0435\u0442. \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u044d\u0442\u043e \u0430\u0434\u0441\u043a\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u0430. \u0422\u0430\u043a \u0447\u0442\u043e \u043d\u0430 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0441\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u0445 \u0438 \u0440\u0438\u0441\u043a.<\/p>\n<p>  \u042f \u0434\u043e\u043b\u0433\u043e \u0438\u0441\u043a\u0430\u043b \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0434\u043b\u044f \u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u043e\u0432 \u043d\u0430 Go \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u043b\u0430 \u0431\u044b \u043c\u043e\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b (\u0433\u0438\u0431\u043a\u0430\u044f, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u0435\u043c\u0435\u0439\u043b, \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u0430\u044f \u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043b\u043e\u0433\u043e\u0432 \u0432 \u043c\u0443\u0441\u043a\u0443\u043b\u0435)<\/p>\n<p>  \u0421\u043a\u0430\u0436\u0443 \u0447\u0435\u0441\u0442\u043d\u043e \u0438\u0441\u043a\u0430\u043b \u044f \u0434\u043d\u044f \u0442\u0440\u0438 \u0442\u0430\u043a \u043d\u0435 \u0447\u0435\u0433\u043e \u0438 \u043d\u0435 \u043d\u0430\u0448\u0435\u043b. \u041f\u043e\u0442\u043e\u043c \u044f \u043d\u0430\u0447\u0430\u043b \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 (\u043f\u0435\u0440\u0432\u0430\u044f \u0435\u0433\u043e \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u044b\u043b\u0430 \u043e\u0447\u0435\u043d\u044c \u043a\u0440\u0438\u0432\u0430\u044f \u0438 \u0435\u043b\u0435 \u0435\u043b\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430). \u041f\u043e\u0442\u043e\u043c \u044f \u0443\u0434\u0430\u043b\u0438\u043b \u0432\u0435\u0441\u044c \u0442\u043e\u0442 \u043a\u043e\u0434 \u0438 \u043d\u0430\u0447\u0430\u043b <s>\u0434\u0443\u043c\u0430\u0442\u044c<\/s> \u043f\u0438\u0441\u0430\u0442\u044c \u0437\u0430\u043d\u043e\u0432\u043e. <\/p>\n<p>  \u042f \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u043d\u044f\u043b \u0447\u0442\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0431\u0434 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043e\u0447\u0435\u043d\u044c \u0443\u0442\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u043e. \u041f\u043e \u044d\u0442\u043e\u043c\u0443 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0442\u0430\u043a:<\/p>\n<p>  \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043b\u043e\u0433\u043e\u0432 \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u043b\u044e\u0447 \u0432 \u0440\u0435\u0434\u0438\u0441\u0435 \u043a\u0443\u0434\u0430 \u043f\u0438\u0448\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0442\u0430\u043a\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0414\u0430\u043d\u043d\u044b\u0435 \u0432 \u0440\u0435\u0434\u0438\u0441\u0435<\/b><\/p>\n<div class=\"spoiler_text\"><code> ('Debug','2015-11-05 20:12:37.700052989 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.700506704 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.700663127 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.700803651 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.700987999 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.701128513 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.701293643 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.701433496 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.701602372 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.701745287 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.701925988 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.702093499 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.702276867 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.702431455 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.702581625 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.702738953 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.702899007 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.703055622 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.703210768 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.70340691 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.703566623 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.7037252 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.703954549 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.704119435 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.704281902 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.704536707 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.704721061 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.704901908 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.705106033 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.705284342 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.705465074 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.705633484 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.705802108 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.705962381 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.706129288 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.706314702 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.706463092 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.706674268 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.706848586 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.707050005 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.707221136 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.707379335 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.707583978 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.707742422 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.707967253 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.708164671 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.708410554 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.708578324 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.708775197 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.708955609 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.709184168 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.709349784 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.709510939 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.709726286 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.709940253 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.710141611 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.71034329 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.710537637 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.710763157 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.710969449 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.711167704 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.711355522 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.711550562 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.711756 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.712048767 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.712273974 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.712517739 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.712828333 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.71306392 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.713335398 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.713570618 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.71389819 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.714182802 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.714448273 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.714754937 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.715018147 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.715291228 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.715596998 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.715910118 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.7162719 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.716552975 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.716807074 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.717153412 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.717434854 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.717704591 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.717991896 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.718283451 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.718590239 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.718849058 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.719152303 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.719424972 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.719734567 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.720070491 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.720386241 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.720651655 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.72094698 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.721207595 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.721514296 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.721776408 +0200 EET','Testing'),('Debug','2015-11-05 20:12:37.722090163 +0200 EET','Testing'), <\/code>  <\/div>\n<\/div>\n<p>  \u042f \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u0445\u043e\u0442\u0435\u043b \u0438\u0445 \u0432\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432 sql \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u043e \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0443 sql \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430. \u042f \u0434\u043e\u043b\u0433\u043e <s>\u0431\u0438\u043b\u0441\u044f \u0433\u043e\u043b\u043e\u0432 \u043e\u0431 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0443<\/s> \u0438\u0441\u043a\u0430\u043b \u0431\u0430\u0433\u0443 \u0432 \u043a\u043e\u0434\u0435, \u0430 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0447\u0442\u043e \u0438\u0437 \u2014 \u0437\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0440\u0435\u0434\u0438\u0441 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043c\u0430. \u041a\u043e\u0433\u0434\u0430 \u044f \u0435\u0451 \u0437\u0430\u043c\u0435\u0442\u0438\u043b \u044f <s>\u0434\u043e\u043b\u0433\u043e \u0433\u0443\u0433\u043b\u0438\u043b<\/s> \u0441\u043f\u0440\u043e\u0441\u0438\u043b \u043d\u0430 \u0442\u043e\u0441\u0442\u0435\u0440\u0435 \u043a\u0430\u043a \u0436\u0435 \u0443\u0431\u0440\u0430\u0442\u044c \u044d\u0442\u0443 \u043a\u043e\u043c\u0443. \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0449\u0435 \u043d\u0435\u043a\u0443\u0434\u0430   <\/p>\n<pre><code class=\"go\">strings.TrimRight(data, &quot;,&quot;) <\/code><\/pre>\n<p>  \u041f\u043e\u0442\u043e\u043c \u044f \u043d\u0430\u0447\u0430\u043b \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435. \u0421\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u044f \u043f\u043e\u043d\u044f\u043b <s>\u0447\u0442\u043e \u044f \u043e\u0441\u0451\u043b<\/s> \u0447\u0442\u043e \u044d\u0442\u043e \u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u043c\u043e\u0433\u0443 \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b\u043d\u0435\u0441 \u0435\u0451 \u0432 \u0434\u0435\u043c\u043e\u043d. <\/p>\n<p>  \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u044f \u0438\u043c\u0435\u044e <br \/>  \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 -&gt; \u043f\u0438\u0448\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0440\u0435\u0434\u0438\u0441. \u0412\u0441\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0430 \u0440\u0435\u0434\u0438\u0441<br \/>  \u0414\u0435\u043c\u043e\u043d -&gt; \u043e\u0434\u043d\u0438\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0432\u0441\u0435 \u043b\u043e\u0433\u0438 \u0441 \u0440\u0435\u0434\u0438\u0441\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u044e \u0432 mysql<\/p>\n<p>  \u041d\u0430 \u0441\u043b\u0430\u0431\u043e\u043c \u0432\u043f\u0441 (\u0447\u0430\u0441\u0442\u043e\u0442\u0430 1.6; 1\u044f\u0434\u0440\u043e, 2 \u0433\u0431 \u043e\u0437\u0443) 1 000 000 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 \u043c\u0443\u0441\u043a\u0443\u043b\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u043e\u0441\u044c \u0437\u0430 25\u043c\u043b.\u0441\u0435\u043a (\u0431\u0434 \u0431\u0435\u0437 \u0442\u044e\u043d\u0438\u043d\u0433\u0430) \u043f\u0440\u0430\u0432\u0434\u0430 \u0432 \u0440\u0435\u0434\u0438\u0441 \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0438\u0441\u0430\u043b\u0438\u0441\u044c \u043e\u043a\u043e\u043b\u043e 6 \u043c\u0438\u043d\u0443\u0442. \u0412\u0441\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0430 \u043d\u0430 \u0440\u0435\u0434\u0438\u0441\u0435. <\/p>\n<p>  \u0412\u043e\u0442 \u0432\u0440\u043e\u0434\u0435 \u0438 \u0432\u0441\u0451.   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u043a\u043e\u043d\u0444\u0438\u0433<\/b><\/p>\n<div class=\"spoiler_text\"><code> { \t \t&quot;MailConf&quot;  : [ \t\t&quot;\u043b\u043e\u0433\u0438\u043d \u043d\u0430 smtp \u0441\u0435\u0440\u0432\u0435\u0440\u0435&quot;,   \t\t&quot;\u043f\u0430\u0440\u043e\u043b\u044c&quot;,       \t\t&quot;smtp \u0441\u0435\u0440\u0432\u0435\u0440&quot;,  \t\t&quot;\u043f\u043e\u0440\u0442 smtp \u0441\u0435\u0440\u0432\u0435\u0440\u0430&quot; \t], \t \t&quot;MailTo&quot;    : [ \t\t&quot;\u043d\u0430_\u043a\u0430\u043a\u0438\u0435_\u0435\u043c\u0435\u0439\u043b\u044b_\u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c@gmail.com&quot;,     \t\t&quot;v.grabko99@yandex.ru&quot; \t], \t \t&quot;Types&quot;     : [ \t\t&quot;Debug&quot;, \t\t&quot;Info&quot;, \t\t&quot;Warn&quot;, \t\t&quot;Error&quot;, \t\t&quot;Fatal&quot; \t],  \t&quot;EmailSend&quot; : [ \t\t&quot;Error&quot;, \t\t&quot;Fatal&quot; \t],  \t&quot;Redis&quot; : [ \t\t&quot;localhost:6379&quot;, \t\t&quot;parsh888&quot;, \t\t&quot;log_&quot; \t],  \t&quot;MysqlConnect&quot; : [ \t\t&quot;\u044e\u0437\u0435\u0440&quot;, \t\t&quot;\u043f\u0430\u0440\u043e\u043b\u044c&quot;, \t\t&quot;\u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445&quot; \t],  \t&quot;MysqlTable&quot; : &quot;log&quot;, \t&quot;ReplicationTimeSecond&quot; : 320  } <\/code>  <\/div>\n<\/div>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"go\">package GeneralsLog  import ( \t&quot;encoding\/json&quot; \t&quot;gopkg.in\/redis.v3&quot; \t&quot;io\/ioutil&quot; \t&quot;log&quot; \t&quot;microService\/libs\/mail&quot; \t&quot;time&quot; )  type Config struct { \tMailTo, MailConf, Types, EmailSend, Redis, MysqlConnect []string \tMysqlTable                                              string }  var ( \tR           *redis.Client \tMailConf    map[string]string \tMailTo      []string \tTypes       []string \tEmailSend   []string \tRedisConfig []string  \t\/\/\u041f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0430\u043c\u0438 \tconfig_file string = &quot;\/home\/v-smerti\/localhost\/api\/src\/microService\/config\/log.json&quot; )  func init() {  \t\/\/\u0421\u043f\u0430\u0440\u0441\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433 \tbs, err := ioutil.ReadFile(config_file) \tif err != nil { \t\tlog.Panicln(err) \t}  \tb := []byte(bs) \tvar conf Config \terr = json.Unmarshal(b, &#038;conf) \tif err != nil { \t\tlog.Panicln(err) \t} \t\/\/\u041f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433 \u0444\u0430\u0439\u043b\u0430 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \tMail<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-267588","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/267588","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=267588"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/267588\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=267588"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=267588"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=267588"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}