{"id":332,"date":"2018-05-24T04:21:21","date_gmt":"2018-05-23T19:21:21","guid":{"rendered":"https:\/\/jidouka.work\/?p=332"},"modified":"2018-05-27T13:38:03","modified_gmt":"2018-05-27T04:38:03","slug":"go%e8%a8%80%e8%aa%9e%e3%81%a8beego%e3%81%ab%e3%82%88%e3%82%8bweb%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e9%96%8b%e7%99%ba%ef%bc%88%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88","status":"publish","type":"post","link":"https:\/\/jidouka.work\/?p=332","title":{"rendered":"Go\u8a00\u8a9e\u3068beegae\u306b\u3088\u308bWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\uff08\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff09"},"content":{"rendered":"<p>Go\u8a00\u8a9e\u7528\u306eWeb Application Framework\uff08WAF\uff09\u306f\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059\u3002<br \/>\n\u305d\u306e\u4e2d\u3067\u3082\u30d5\u30eb\u30b9\u30bf\u30c3\u30af\u304b\u3064Google App Engine\uff08GAE\uff09\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u308bWAF\u306fbeegae\u3067\u3059\u3002<br \/>\nbeegae\u306fbeego\u306eGAE\u5bfe\u5fdc\u7248\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u901a\u5e38\u306ebeego\u3067\u306f\u5185\u90e8\u7684\u306bGAE\u3067\u306f\u4f7f\u7528\u3067\u304d\u306a\u3044\u6a5f\u80fd\u3092\u4f7f\u7528\u3057\u3066\u304a\u308a\u3001\u5b9f\u884c\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u6b63\u5e38\u306b\u30d3\u30eb\u30c9\u3067\u304d\u307e\u305b\u3093\u3002<br \/>\n\u305d\u306e\u305f\u3081\u3001GAE\u4ee5\u5916\u3067beego\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f\u901a\u5e38\u306ebeego\u3001GAE\u4e0a\u3067beego\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306fbeegae\u3092import\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h2 id=\"beegae-\">beegae\u306e\u5c0e\u5165\u624b\u9806<\/h2>\n<p>beegae\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\u306fbeegae\u306egithub\u306b\u8a18\u8f09\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/github.com\/astaxie\/beegae\">GitHub &#8211; astaxie\/beegae: beego for GAE<\/a><\/p>\n<p>\u4ee5\u4e0b\u306fimport\u624b\u9806\u3067\u3059\u3002<\/p>\n<figure class=\"jd-code\"><button type=\"button\" class=\"jd-code-copy\">\u30b3\u30d4\u30fc<\/button><pre><code class=\"language-plaintext\">&lt;code&gt;# go get github.com\/astaxie\/beegae\r\n# go get github.com\/beego\/bee\r\n# cd $GOPATH\/src\r\n# $GOPATH\/bin\/bee new hellogae  \/\/\u65b0\u898f\u4f5c\u6210\u3059\u308b\u30a2\u30d7\u30ea\u540d\u3092\u6307\u5b9a\r\n# cd hellogae\r\n&lt;\/code&gt;<\/code><\/pre><\/figure>\n<h2 id=\"app-yaml-\">app.yaml\u306e\u4f5c\u6210<\/h2>\n<p>\u6b21\u306bapp.yaml\u306e\u4f5c\u6210\u3068\u306a\u308a\u307e\u3059\u3002<br \/>\nGAE\u306eapp.yaml\u306e\u8a18\u8ff0\u65b9\u6cd5\u306e\u8a73\u3057\u3044\u8aac\u660e\u306fGoogle Cloud\u306e\u30da\u30fc\u30b8\u306b\u3042\u308a\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/cloud.google.com\/appengine\/docs\/standard\/go\/config\/appref\">app.yaml Reference  |  App Engine standard environment for Go  |  Google Cloud<\/a><\/p>\n<p>beegae\u306e\u30da\u30fc\u30b8\u3067\u306f\u30b9\u30bf\u30f3\u30c0\u30fc\u30c9\u74b0\u5883\u3068\u30d5\u30ec\u30ad\u30b7\u30d6\u30eb\u74b0\u5883\u306e2\u901a\u308a\u306e\u8a18\u8ff0\u65b9\u6cd5\u304c\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n\u4e21\u74b0\u5883\u306e\u9055\u3044\u306b\u3064\u3044\u3066\u306fGoogle Cloud\u306e\u30da\u30fc\u30b8\u306b\u8aac\u660e\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/cloud.google.com\/appengine\/docs\/flexible\/java\/flexible-for-standard-users?hl=ja\">App Engine \u30b9\u30bf\u30f3\u30c0\u30fc\u30c9\u74b0\u5883\u30e6\u30fc\u30b6\u30fc\u306e\u305f\u3081\u306e App Engine \u30d5\u30ec\u30ad\u30b7\u30d6\u30eb\u74b0\u5883  |  Java \u306e App Engine \u30d5\u30ec\u30ad\u30b7\u30d6\u30eb\u74b0\u5883\u306b\u95a2\u3059\u308b\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8  |  Google Cloud<\/a><\/p>\n<p>\u4e0a\u8a18\u8aac\u660e\u306fJava\u306e\u65e5\u672c\u8a9e\u30da\u30fc\u30b8\u3067\u3059\u304c\uff08Go\u306e\u30da\u30fc\u30b8\u306f\u82f1\u8a9e\u306e\u307f\uff09\u3001\u52d5\u4f5c\u306fGo\u3067\u3082\u540c\u3058\u3067\u3059\u3002<\/p>\n<p>\u901a\u5e38\u306f\u30bf\u30f3\u30c0\u30fc\u30c9\u74b0\u5883\u306eapp.yaml\u3067\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<figure class=\"jd-code\"><button type=\"button\" class=\"jd-code-copy\">\u30b3\u30d4\u30fc<\/button><pre><code class=\"language-plaintext\">&lt;code&gt;application: hellobeegae\r\nversion: 1\r\nruntime: go\r\nthreadsafe: true\r\napi_version: go1\r\n\r\nhandlers:\r\n- url: \/.*\r\n  script: _go_app\r\n&lt;\/code&gt;<\/code><\/pre><\/figure>\n<h2 id=\"-\">\u30d5\u30a1\u30a4\u30eb\u306e\u66f8\u304d\u63db\u3048<\/h2>\n<p>\u6700\u5f8c\u306bgofmt\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u66f8\u304d\u63db\u3048\u3066\u3001\u5404\u30d5\u30a1\u30a4\u30eb\u3092\u79fb\u52d5\u3057\u307e\u3059\u3002<\/p>\n<figure class=\"jd-code\"><button type=\"button\" class=\"jd-code-copy\">\u30b3\u30d4\u30fc<\/button><pre><code class=\"language-plaintext\">&lt;code&gt;# gofmt -r &#039;&quot;github.com\/astaxie\/beego&quot; -&gt; &quot;github.com\/astaxie\/beegae&quot;&#039; -w .\/\r\n# gofmt -r &#039;beego -&gt; beegae&#039; -w .\/\r\n# mkdir main &amp;&amp; mv main.go main\/ &amp;&amp; mv app.yaml main\/ &amp;&amp; mv conf\/ main\/ &amp;&amp; mv views\/ main\/ &amp;&amp; cd main\/\r\n&lt;\/code&gt;<\/code><\/pre><\/figure>\n<p>\u901a\u5e38\u306eApp Engine\u3067\u52d5\u4f5c\u3055\u305b\u308b\u305f\u3081\u306b\u306fmain\u95a2\u6570\u3092init\u95a2\u6570\u306b\u66f8\u304d\u63db\u3048\u307e\u3059\u3002<\/p>\n<h2 id=\"-\">\u5b9f\u884c<\/h2>\n<figure class=\"jd-code\"><button type=\"button\" class=\"jd-code-copy\">\u30b3\u30d4\u30fc<\/button><pre><code class=\"language-plaintext\">&lt;code&gt;# goapp serve\r\n&lt;\/code&gt;<\/code><\/pre><\/figure>\n<p>\u5b9f\u884c\u3057\u3066<a href=\"http:\/\/localhost:8080\">http:\/\/localhost:8080<\/a>\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u4ee5\u4e0b\u306e\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308c\u3070\u6b63\u5e38\u306b\u52d5\u4f5c\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/jidouka.work\/wp-content\/uploads\/2018\/05\/fb01442b378ededc8163370c2e69058a.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jidouka.work\/wp-content\/uploads\/2018\/05\/fb01442b378ededc8163370c2e69058a-300x201.jpg\" alt=\"beegae index page\" width=\"300\" height=\"201\" class=\"alignnone size-medium wp-image-334\" srcset=\"https:\/\/jidouka.work\/wp-content\/uploads\/2018\/05\/fb01442b378ededc8163370c2e69058a-300x201.jpg 300w, https:\/\/jidouka.work\/wp-content\/uploads\/2018\/05\/fb01442b378ededc8163370c2e69058a-768x514.jpg 768w, https:\/\/jidouka.work\/wp-content\/uploads\/2018\/05\/fb01442b378ededc8163370c2e69058a.jpg 996w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/localhost:8000\">http:\/\/localhost:8000<\/a>\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u52d5\u4f5c\u4e2d\u306eApp Engine\u306e\u72b6\u614b\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/jidouka.work\/wp-content\/uploads\/2018\/05\/8b03ad05f5ade371a0ef46693fdefc23.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jidouka.work\/wp-content\/uploads\/2018\/05\/8b03ad05f5ade371a0ef46693fdefc23-300x165.jpg\" alt=\"GAE status\" width=\"300\" height=\"165\" class=\"alignnone size-medium wp-image-335\" srcset=\"https:\/\/jidouka.work\/wp-content\/uploads\/2018\/05\/8b03ad05f5ade371a0ef46693fdefc23-300x165.jpg 300w, https:\/\/jidouka.work\/wp-content\/uploads\/2018\/05\/8b03ad05f5ade371a0ef46693fdefc23-768x423.jpg 768w, https:\/\/jidouka.work\/wp-content\/uploads\/2018\/05\/8b03ad05f5ade371a0ef46693fdefc23-1024x564.jpg 1024w, https:\/\/jidouka.work\/wp-content\/uploads\/2018\/05\/8b03ad05f5ade371a0ef46693fdefc23.jpg 1028w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Go\u8a00\u8a9e\u7528\u306eWeb Application Framework\uff08WAF\uff09\u306f\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059\u3002 \u305d\u306e\u4e2d &#8230; <\/p>\n","protected":false},"author":1,"featured_media":334,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[25,24,26],"class_list":["post-332","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-go","tag-beego","tag-google-app-engine","tag-web-application-framework"],"_links":{"self":[{"href":"https:\/\/jidouka.work\/index.php?rest_route=\/wp\/v2\/posts\/332","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jidouka.work\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jidouka.work\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jidouka.work\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jidouka.work\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=332"}],"version-history":[{"count":4,"href":"https:\/\/jidouka.work\/index.php?rest_route=\/wp\/v2\/posts\/332\/revisions"}],"predecessor-version":[{"id":348,"href":"https:\/\/jidouka.work\/index.php?rest_route=\/wp\/v2\/posts\/332\/revisions\/348"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jidouka.work\/index.php?rest_route=\/wp\/v2\/media\/334"}],"wp:attachment":[{"href":"https:\/\/jidouka.work\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=332"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jidouka.work\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=332"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jidouka.work\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=332"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}