{"id":192565,"date":"2020-11-11T14:43:43","date_gmt":"2020-11-11T06:43:43","guid":{"rendered":"http:\/\/4563.org\/?p=192565"},"modified":"2020-11-11T14:43:43","modified_gmt":"2020-11-11T06:43:43","slug":"mixgo-v1-0-%e5%8f%91%e5%b8%83%ef%bc%8c%e6%b7%b7%e5%90%88%e5%9e%8b%e9%ab%98%e6%80%a7%e8%83%bd-go-%e6%a1%86%e6%9e%b6","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=192565","title":{"rendered":"MixGo V1.0 \u53d1\u5e03\uff0c\u6df7\u5408\u578b\u9ad8\u6027\u80fd Go \u6846\u67b6"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  MixGo V1.0 \u53d1\u5e03\uff0c\u6df7\u5408\u578b\u9ad8\u6027\u80fd Go \u6846\u67b6               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : onanying <\/span>  <span><i><\/i> 2<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<h2>Mix Go \u662f\u4ec0\u4e48<\/h2>\n<p>Mix Go \u662f\u6df7\u5408\u578b\u9ad8\u6027\u80fd Go \u6846\u67b6\uff0c\u8be5\u6846\u67b6\u6539\u9020\u6574\u5408\u4e86 <code>gin<\/code>, <code>logrus<\/code>, <code>gorm<\/code>, <code>go-redis<\/code>, <code>jwt-go<\/code>, <code>gorilla<\/code> &#8230; \u7b49\u591a\u4e2a\u6d41\u884c\u7ec4\u4ef6\uff0c\u53ef\u4ee5\u5f00\u53d1 <code>console<\/code>, <code>api<\/code>, <code>web<\/code>, <code>grpc<\/code> \u7b49\u5404\u79cd\u9879\u76ee\uff0c\u5e76\u4e14\u5f15\u5165\u4e86\u4f9d\u8d56\u6ce8\u5165\u3001\u63a7\u5236\u53cd\u8f6c\u3001\u4e8b\u4ef6\u9a71\u52a8\u7b49\u9ad8\u7ea7\u7279\u5f81\uff0c\u6846\u67b6\u8ffd\u6c42\u7b80\u5355\u5b9e\u7528\u4e3b\u4e49\uff0c\u8bd5\u56fe\u8ba9\u66f4\u591a\u5f00\u53d1\u8005\u4ee5\u66f4\u4f4e\u7684\u5b66\u4e60\u6210\u672c\u83b7\u5f97\u6781\u5177\u751f\u4ea7\u529b\u7684\u7b2c\u4e8c\u7f16\u7a0b\u8bed\u8a00\u3002<\/p>\n<h2>\u4e0e\u5176\u4ed6 Go \u6846\u67b6\u7684\u5dee\u522b<\/h2>\n<ul>\n<li>\n<p>\u9aa8\u67b6\u4ee3\u7801\u5168\u90e8\u57fa\u4e8e bean, event \u4f9d\u8d56\u6ce8\u5165\u3001\u63a7\u5236\u53cd\u8f6c\u3001\u4e8b\u4ef6\u9a71\u52a8\u5e93\u6784\u5efa\uff0c\u540c\u65f6\u5185\u7f6e\u4e86 Go \u751f\u6001\u5404\u4e2a\u9886\u57df\u6700\u6d41\u884c\u7684\u5e93\uff0c\u5305\u62ec gin, logrus, gorm \u7b49\uff0c\u5e76\u4e14\u8fd9\u4e9b\u79bb\u6563\u7684\u5e93\u5df2\u7ecf\u88ab\u6574\u5408\u4e3a\u4e00\u4f53\uff0c\u53ef\u4ee5\u76f8\u4e92\u5173\u8054\u4f7f\u7528\u3002<\/p>\n<\/li>\n<li>\n<p>\u9aa8\u67b6\u5185\u7f6e\u4e86 gin \u4f5c\u4e3a\u670d\u52a1\u5668\uff0cgin \u4e25\u683c\u6765\u8bb2\u5e76\u4e0d\u662f\u6846\u67b6\uff0c\u800c\u662f\u4e00\u4e2a server \u5e93\uff0c\u53ea\u63d0\u4f9b\u4e86\u670d\u52a1\u5668\u76f8\u5173\u7684\u529f\u80fd\uff0c\u8bf7\u6c42\u5904\u7406\uff0c\u4e2d\u95f4\u4ef6\uff0c\u89c6\u56fe\u6e32\u67d3\u7b49\u3002<\/p>\n<\/li>\n<li>\n<p>\u4e0e beego \u7b49\u5176\u4ed6 go \u6846\u67b6\u4e0d\u540c\u7684\u662f\uff0cmix-go \u7684\u4f9d\u8d56\u5e93\u5168\u90e8\u662f\u72ec\u7acb\u4ed3\u5e93\uff0c\u5f53\u4f60\u53ea\u60f3\u4f7f\u7528\u67d0\u4e00\u4e2a\u5e93\u65f6\uff0c\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u8bed\u4e49\u5316\u7248\u672c\u53f7\uff0c\u800c\u4e0d\u662f commitid \u7248\u672c\u53f7\u3002<\/p>\n<\/li>\n<li>\n<p>\u63d0\u4f9b\u4e86 console, api, web, grpc \u591a\u79cd\u9aa8\u67b6\u751f\u6210\u5de5\u5177\uff0c\u540c\u65f6\u9aa8\u67b6\u4ee3\u7801\u4e2d\u5305\u542b\u975e\u5e38\u4e30\u5bcc\u7684\u8303\u4f8b\uff0c\u5f00\u7bb1\u5373\u7528\u3002<\/p>\n<\/li>\n<li>\n<p>\u91c7\u7528\u9ad8\u5ea6\u7075\u6d3b\u7684\u5f00\u53d1\u65b9\u5f0f\uff0c\u6846\u67b6\u53ea\u63d0\u4f9b\u5e95\u5c42\u5e93\uff0c\u800c\u4e0e\u5177\u4f53\u529f\u80fd\u76f8\u5173\u7684\u4ee3\u7801\u90fd\u5728\u9aa8\u67b6\u4ee3\u7801\u4e2d\u5b9e\u73b0\uff0c\u7528\u6237\u80fd\u66f4\u52a0\u7ec6\u7c92\u5ea6\u7684\u4fee\u6539\u6bcf\u4e00\u5904\u7ec6\u8282\u3002<\/p>\n<\/li>\n<li>\n<p>\u6846\u67b6\u975e\u5e38\u8f7b\u91cf\u7075\u6d3b\uff0c\u4f9d\u8d56\u5e93\u5747\u53ef\u72ec\u7acb\u4f7f\u7528\uff0c\u4e25\u683c\u6765\u8bb2\u9664\u4e86 console \u547d\u4ee4\u884c\u5f00\u53d1\u7ec4\u4ef6\uff0c\u5176\u4ed6\u5168\u90e8\u4e3a\u9009\u88c5\u3002<\/p>\n<\/li>\n<li>\n<p>\u7531\u4e8e\u9aa8\u67b6\u548c\u6838\u5fc3\u7c7b\u5e93\u90fd\u7531 Mix \u81ea\u5df1\u6253\u9020\uff0c\u62e5\u6709\u548c MixPHP \u540c\u6837\u7684\u8bbe\u8ba1\u54f2\u5b66\uff0cPHP \u7684\u7528\u6237\u53ef\u4ee5\u5f88\u5bb9\u6613\u4e0a\u624b\u5f00\u53d1\u3002<\/p>\n<\/li>\n<\/ul>\n<h2>\u4e0e Mix PHP \u7684\u5173\u7cfb<\/h2>\n<p>\u8be5\u6846\u67b6\u4e0e MixPHP \u8bbe\u8ba1\u54f2\u5b66\u51e0\u4e4e\u5b8c\u5168\u4e00\u81f4\uff0cPHP \u7684\u7528\u6237\u53ef\u4ee5\u975e\u5e38\u5bb9\u6613\u7684\u5207\u6362\u5230 MixGo \u8fdb\u884c\u5f00\u53d1\uff0c\u8fbe\u5230\u5b66\u4e00\u4f1a\u4e8c\u7684\u6548\u679c\uff0cOpenMix \u53ef\u80fd\u662f\u73b0\u5728\u552f\u4e00\u4e00\u4e2a\u6253\u9020\u8de8\u8bed\u8a00\u6846\u67b6\u7684\u5f00\u6e90\u673a\u6784\u3002<\/p>\n<h2>\u5fae\u670d\u52a1<\/h2>\n<p>\u7531\u4e8e gin \u4e0e go-micro \u662f\u517c\u5bb9\u7684\uff0c\u56e0\u6b64\u53ef\u4ee5\u975e\u5e38\u65b9\u4fbf\u7684\u6269\u5c55\u4e3a\u5fae\u670d\u52a1\u3002<\/p>\n<h2>\u6846\u67b6\u5b9a\u4f4d<\/h2>\n<p>\u5f53\u6211\u4eec\u5f00\u53d1 MixPHP \u65f6\u53d1\u73b0\u6846\u67b6\u7684\u8bbe\u8ba1\u54f2\u5b66\u53ef\u4ee5\u590d\u5236\u5230 Go \u751f\u6001\uff0c\u4e8e\u662f\u6211\u4eec\u7740\u624b\u5b9e\u73b0\u8ba9\u66f4\u591a\u7684 PHP \u4e2d\u7ea7\u7a0b\u5e8f\u5458\u4e5f\u53ef\u4f7f\u7528 Go \u6253\u9020\u9ad8\u5e76\u53d1\u7cfb\u7edf\uff0c\u8ba9 Mix \u7684\u7528\u6237\u80fd\u5b66\u4e00\u4f1a\u4e8c\uff0c\u5b9e\u73b0\u8de8\u8bed\u8a00\u65e0\u5dee\u522b\u5f00\u53d1\u3002<\/p>\n<h2>\u5f00\u53d1\u6587\u6863<\/h2>\n<ul>\n<li>https:\/\/openmix.org\/mix-go\/doc<\/li>\n<li>https:\/\/www.kancloud.cn\/onanying\/mixgo1\/content<\/li>\n<\/ul>\n<h2>\u6280\u672f\u4ea4\u6d41<\/h2>\n<p>\u77e5\u4e4e\uff1a https:\/\/www.zhihu.com\/people\/onanying<br \/> \u5fae\u535a\uff1a http:\/\/weibo.com\/onanying<br \/> \u5b98\u65b9 QQ \u7fa4\uff1a284806582, 825122875\uff0c\u6572\u95e8\u6697\u53f7\uff1agoer<\/p>\n<h2>\u5feb\u901f\u5f00\u59cb<\/h2>\n<ul>\n<li>\u5b89\u88c5\u5f00\u53d1\u5de5\u5177<\/li>\n<\/ul>\n<pre><code>go get -u github.com\/mix-go\/mix <\/code><\/pre>\n<ul>\n<li>\u521b\u5efa <code>api<\/code> \u5e94\u7528\u9aa8\u67b6<\/li>\n<\/ul>\n<pre><code>mix api --name=hello <\/code><\/pre>\n<ul>\n<li>\u7f16\u8bd1\u5230\u9aa8\u67b6\u7684 <code>bin<\/code> \u76ee\u5f55<\/li>\n<\/ul>\n<pre><code>cd hello go build -o bin\/go_build_main_go main.go <\/code><\/pre>\n<ul>\n<li>\u6267\u884c<\/li>\n<\/ul>\n<pre><code>cd bin .\/go_build_main_go <\/code><\/pre>\n<ul>\n<li>\u542f\u52a8 <code>api<\/code><\/li>\n<\/ul>\n<pre><code>$&gt; .\/go_build_main_go api              ___           ______ ___  _ \/__ ___ _____ ______    \/ __ `__ \/ \/ \/ \/__  __ `\/  __   \/ \/ \/ \/ \/ \/ \/ \/ \/ _  \/_\/ \/\/ \/_\/ \/ \/_\/ \/_\/ \/_\/_\/ \/_\/_  __, \/ ____\/                       \/____\/   Server      Name:     mix-api System      Name:     darwin Go          Version:  1.13.4 Framework   Version:  1.0.5 Listen      Addr:     :8080 time=2020-08-28 18:54:31 level=info msg=Server start file=api.go:58 <\/code><\/pre>\n<p>\u8bbf\u95ee\u6d4b\u8bd5 (\u65b0\u5f00\u4e00\u4e2a\u7ec8\u7aef)\uff1a<\/p>\n<pre><code>$&gt; curl http:\/\/127.0.0.1:8080\/hello {\"message\":\"hello, world!\",\"status\":200} <\/code><\/pre>\n<h2>\u5f00\u53d1\u5de5\u5177<\/h2>\n<p>\u6e90\u7801\u4ed3\u5e93\u4e2d\u4e0d\u4ec5\u5305\u542b\u5168\u90e8\u7ec4\u4ef6\u7684\u6e90\u7801\uff0c\u8fd8\u5305\u542b\u4e00\u4e2a\u5f00\u53d1\u5de5\u5177\uff1a<\/p>\n<ul>\n<li>\u53ef\u4ee5\u751f\u6210 <code>console<\/code>, <code>api<\/code>, <code>web<\/code>, <code>grpc<\/code> \u7b49\u9aa8\u67b6\u4ee3\u7801<\/li>\n<li>\u70ed\u66f4\u65b0\u5de5\u5177 (\u5f00\u53d1\u4e2d)<\/li>\n<\/ul>\n<h3>Installation<\/h3>\n<ul>\n<li>\u5b89\u88c5<\/li>\n<\/ul>\n<pre><code>go get -u github.com\/mix-go\/mix <\/code><\/pre>\n<h3>Help<\/h3>\n<p>\u67e5\u770b\u547d\u4ee4\u5e2e\u52a9<\/p>\n<pre><code>$ mix Usage: mix [OPTIONS] COMMAND [opt...]  Commands:   version       Prints the current Mix Go version   new           Create a console application   api           Create a api application   web           Create a web application   grpc          Create a gRPC application  Global Options:   -h, --help    Print usage   -v, --version Print version information   Run 'mix COMMAND --help' for more information on a command.  Developed with Mix Go framework. (openmix.org\/mix-go) <\/code><\/pre>\n<h3>New application<\/h3>\n<p>\u521b\u5efa\u5e94\u7528\u9aa8\u67b6<\/p>\n<ul>\n<li>console<\/li>\n<\/ul>\n<pre><code>mix new --name=hello <\/code><\/pre>\n<ul>\n<li>api<\/li>\n<\/ul>\n<pre><code>mix api --name=hello <\/code><\/pre>\n<ul>\n<li>web (\u542b websocket)<\/li>\n<\/ul>\n<pre><code>mix web --name=hello <\/code><\/pre>\n<ul>\n<li>grpc<\/li>\n<\/ul>\n<pre><code>mix grpc --name=hello <\/code><\/pre>\n<h2>License<\/h2>\n<p>Apache License Version 2.0, http:\/\/www.apache.org\/licenses\/<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>8<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4158620\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : kuro1 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             gopher                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4158621\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hgjian <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u4e0d\u641e php \u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4158622\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : kwanzaa <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5934\u76ae\u53d1\u9ebb                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4158623\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : SingeeKing <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u66ff\u4e3b\u8865\u5145\u4e00\u4e0b Github \u94fe\u63a5\uff1a https:\/\/github.com\/mix-go\/mix                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4158624\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ben1024 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             golang \u6846\u67b6\u5176\u5b9e\u8fd8\u597d\uff0c\u4e3b\u8981\u662f\u751f\u6001\u8f83\u5f31<br \/>\u8fd8\u6709\u5c31\u662f\u53d1\u9519\u5206\u7ec4\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4158625\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : frozenshadow <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8bf7\u6559\u4e00\u4e0b gin \u548c go-micro \u517c\u5bb9\u662f\u6307\u54ea\u65b9\u9762\u554a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4158626\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : onanying <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @hgjian \u90fd\u641e\uff0cmixphp + mixgo = openmix.org                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4158627\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : onanying <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @frozenshadow go-micro v2 \u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 gin beego \u7684 route \u4f5c\u4e3a web\/api \u7684\u89e3\u6790\uff0c\u7136\u540e\u540c\u6837\u53ef\u4ee5\u6ce8\u518c\u5230 go-micro \u5fae\u670d\u52a1\u6ce8\u518c\u4e2d\u5fc3                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>MixGo V1.0 \u53d1\u5e03\uff0c\u6df7\u5408\u578b&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/192565"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=192565"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/192565\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=192565"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=192565"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=192565"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}