{"id":1093,"date":"2021-12-24T00:24:20","date_gmt":"2021-12-23T16:24:20","guid":{"rendered":"https:\/\/www.rayer.idv.tw\/blog\/?p=1093"},"modified":"2021-12-24T07:39:07","modified_gmt":"2021-12-23T23:39:07","slug":"google-cloud-functions","status":"publish","type":"post","link":"https:\/\/www.rayer.idv.tw\/blog\/?p=1093","title":{"rendered":"\u5c07\u670d\u52d9\u9077\u79fb\u5230Google Cloud Functions"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u6700\u8fd1\u958b\u59cb\u628a\u8166\u7b4b\u52d5\u5230\u6bcf\u500b\u6708\u8981\u5403\u6389\u621120\u9382\u7684linode\uff0c\u770b\u770b\u80fd\u4e0d\u80fd\u7528Google Compute Platform\u4f86\u53d6\u4ee3\u6389\u55ae\u7d14\u7684VM\u3002GCP\u672c\u8eab\u6709\u63d0\u4f9bFree Tier, \u6240\u4ee5\u53ea\u8981\u5c0f\u5fc3\u5730\u63a7\u5236\u7528\u91cf\uff0c\u642c\u9077\u61c9\u8a72\u662f\u53ef\u4ee5\u7701\u4e0b\u4e00\u7b46\uff0c\u800c\u4e14\u4e5f\u53ef\u4ee5\u73a9\u73a9GCP\u7684\u4e00\u4e9b\u65b0\u529f\u80fd\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u9700\u6c42\u5206\u6790<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u6211\u9019\u6b21\u5148\u642c\u9077\u4e4b\u524d\u5beb\u7684\u4e00\u500b<a href=\"https:\/\/github.com\/Rayer\/AppleTwNCCSpy\">\u722c\u87f2\u670d\u52d9<\/a>\uff0c\u9019\u500b\u722c\u87f2\u670d\u52d9\u61c9\u8a72\u662f\u6211\u73fe\u6709\u670d\u52d9\u88e1\u9762\u6700\u7c21\u55ae\u7684\u4e00\u500b\uff0c\u9996\u5148\u5148\u5206\u6790\u4e00\u4e0b\u4ed6\u6709\u4ec0\u9ebc\u7279\u6027\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u9700\u8981\u5b9a\u6642\u88ab\u559a\u9192\uff08\u8a2d\u8a08\u4e0a\u5927\u698210\u5206\u9418\u4e00\u6b21\u5c31\u5920\u4e86\uff09<\/li><li>\u9700\u8981\u4e00\u500b\u5730\u65b9\u5b58\u653e\u722c\u4e0b\u4f86\u7684\u5206\u6790\u8cc7\u6599<\/li><li>\u4e0d\u9700\u8981\u5be6\u9ad4\u4e0a\u7684Database<\/li><li>\u7a0b\u5f0f\u672c\u9ad4\u76f8\u7576\u5c0f<\/li><\/ul>\n\n\n\n<!--more-->\n\n\n\n<h3 class=\"wp-block-heading\">\u820a\u6709\u7684\u65b9\u6848\u4ee5\u53ca\u7f3a\u9ede<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e4b\u524d\u7684\u65b9\u6848\u662f\u4e00\u500b\u7d14application\uff0c\u8d70infinite for loop\uff0c\u5728\u88e1\u9762\u653eticker\u4f86\u8a08\u664210\u5206\u9418\u4e00\u6b21\uff0c\u7136\u5f8c\u628a\u4ed6\u5305\u6210docker image\u7528daemon mode\u8dd1\u8d77\u4f86\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u9019\u500b\u8dd1\u6cd5\u7b97\u662f\u6eff\u50b3\u7d71\u7684\uff0c\u5728\u975e\u96f2\u7aef\u6642\u4ee3\u4e5f\u662f\u4e00\u500b\u5f88\u6a19\u6e96\u7684\u505a\u6cd5\u3002\u53ea\u662f\u9019\u6a23\u8dd1\u4e86\u5e7e\u500b\u6708\uff0c\u767c\u73fe\u4e86\u6709\u4ee5\u4e0b\u9019\u4e9b\u554f\u984c\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u9700\u8981\u5beb\u4e00\u500bservice script\u4f86\u78ba\u4fddhost vm\u88ab\u91cd\u555f\u7684\u6642\u5019\uff0c\u9019\u500b\u670d\u52d9\u80fd\u5920\u5728\u88ab\u62c9\u8d77\u4f86\u3002<\/li><li>\u9084\u662f\u5f97\u4f54\u8457\u4e00\u584a\u4e0d\u7b97\u5c0f\u7684\u8a18\u61b6\u9ad4\uff0c\u53ea\u70ba\u4e8610\u5206\u9418\u8dd1\u4e00\u6b21\u3002<\/li><li>up\u4e86\u5e7e\u500b\u6708\u6709\u6642\u5019\u6703\u5361\u6b7b\uff0c\u4e5f\u8a31\u6709bug\u4e5f\u8a31\u662fmemory leak\uff0c\u4f46\u662f\u5f9ecode\u5176\u5be6\u770b\u4e0d\u592a\u51fa\u554f\u984c\uff0c\u800c\u4e14\u91cd\u73fe\u4e5f\u6eff\u56f0\u96e3\u7684\u3002<\/li><li><code>docker.io<\/code>\u639b\u9ede\u904e\u5e7e\u6b21\uff0c\u65b0\u7684image\u63a8\u4e0d\u4e0a\u53bb\u62c9\u4e0d\u4e0b\u4f86<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u9019\u4e9b\u554f\u984c\u5176\u5be6\u90fd\u80fd\u4ee5\u50b3\u7d71\u624b\u6bb5\u89e3\u6c7a\uff0c\u6bd4\u65b9\u8aaa\u6700\u7c21\u55ae\u7684\u65b9\u5f0f\u5c31\u662f\u628a\u5b83\u6539\u6210cron job\uff0c\u5f9eOS\u5c64\u9762\u4f86\u6392\u7a0b\u800c\u975ecode\u5c64\u9762\uff0c<code>docker.io<\/code>\u4e5f\u4e0d\u662f\u5f88\u5e38\u639b\u9ede\uff0c\u771f\u7684\u639b\u6389\u7684\u8a71\u6539\u7528\u5176\u4ed6\u514d\u8cbb\u7684image registry\u4e5f\u662f\u53ef\u4ee5\u7684\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u9078\u64c7Serverless<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Google\u63d0\u4f9b\u4e86\u4e09\u7a2e\u4e0d\u540c\u7684\u65b9\u6cd5\u4f86\u4f5cServerless:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Google App Engine<br><ul>\n\t\t\t<li>\u6700\u8001\u724c<\/li>\n\t\t\t<li>\u5982\u679c\u4f60\u7528<a href=\"https:\/\/github.com\/gin-gonic\/gin\">gin-gonic<\/a>\u5beb\u7684\u8a71\uff0c\u9700\u8981\u7684\u6539\u52d5\u76f8\u7576\u5c0f<\/li>\n\t\t\t<li>\u8aaaserverless&#8230;.\u5176\u5be6\u6bd4\u8f03\u50cf\u662f\u4ed6\u5e6b\u4f60host\u4e00\u500bserver\uff0c\u53ea\u662f\u9019\u500bserver\u6703\u81ea\u52d5\u6309\u7167\u9700\u6c42\u5553\u9589\u800c\u5df2\uff0c\u6240\u4ee5\u4ed6\u53ef\u4ee5\u662fstateful<\/li>\n\t\t\t<li>\u652f\u63f4PubSub\uff0c\u4f46\u662f\u662f\u4ee5push\u7684\u5f62\u5f0f\u8d70http route\u9032\u4f86<\/li>\n\t\t\t<li>Debug\/Deploy\u76f8\u6bd4\u65bcCloud Function\u90fd\u7c21\u55ae\u4e00\u9ede<\/li>\n\t\t\t<li>\u6309run quota\u4ed8\u8cbb\uff0c\u4e5f\u5c31\u662f\u53ef\u80fd\u6703\u56e0\u70bacontainer\u8dd1\u5728\u4e0a\u9762\u6bd4\u9810\u671f\u7684\u4e45\uff0c\u6240\u4ee5\u9700\u8981\u4ed8\u7684\u9322\u6bd4\u9810\u671f\u591a\u4e00\u9ede\u3002<\/li>\n\t\t<\/ul><\/li><li>Cloud Functions<br><ul>\n\t\t\t<li>\u6700\u8f15\u91cf<\/li>\n\t\t\t<li>\u5f88\u50cfAWS Lambda<\/li>\n\t\t\t<li>\u539f\u751f\u652f\u63f4PUB\/SUB<\/li>\n\t\t\t<li>Deploy\u5f88\u96e3\u641e\uff0ccommand line\u9817\u8907\u96dc\uff0c\u96d6\u7136\u5f04\u597d\u4ee5\u5f8c\u4e0d\u592a\u6703\u78b0\u5230<\/li>\n\t\t\t<li>\u4e0d\u904edeploy\u4e0d\u9700\u8981by container\u53bbdeploy\uff0c\u5b8c\u5168\u5c31\u662fbuild from source code<\/li>\n\t\t<\/ul><\/li><li>Cloud Run<br><ul>\n\t\t\t<li>\u5f88\u65b0\u7684\u670d\u52d9<\/li>\n\t\t\t<li>\u5176\u5be6\u5c31\u662fCloud Functions\u7684container\u7248\u672c<\/li>\n\t\t\t<li>\u53ef\u4ee5\u60f3\u6210\u662fKnative\u7684POD\uff0c\u8ddfk8s\u7684pod\u8a2d\u5b9a\u53ef\u4ee5\u901a\u7528<br><\/li>\n\t\t<\/ul><\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u9019\u500b\u722c\u87f2\u672c\u8eab\u5403\u7684\u8cc7\u6e90\u4e0d\u591a\uff0c\u4e5f\u4e0d\u9700\u8981http\u8ddf\u5916\u754c\u6e9d\u901a\uff0c\u7528pubsub\u4e5f\u633a\u65b9\u4fbf\u7684\uff0c\u6240\u4ee5\u5c31\u9078\u64c7\u4e86\u7528Cloud Functions\u4f86\u7576\u4f5cdeploy\u7684\u65b9\u6cd5\u3002\u91cd\u9ede\u662f\uff0cCloud Functions\u514d\u8cbb\u984d\u5ea6\u61c9\u8a72\u7b97\u662f\u6700\u5f48\u6027\u7684\uff0c\u61c9\u8a72\u600e\u9ebc\u6253\u90fd\u4e0d\u592a\u6703\u8d85\u904e\u514d\u8cbb\u984d\u5ea6\u4e0a\u9650\uff0c\u6240\u4ee5\u5c31\u7528\u5427\uff01<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5be6\u4f5c<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u7d50\u69cb<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u9810\u671f\u4e2d\u7684\u7d50\u69cb\u6703\u662f\u50cf\u9019\u6a23<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>PubSub\u5b9a\u7fa9\u4e00\u500bmessage<\/li><li>SecretManager\u628aConfig\u653e\u5728\u88e1\u9762<\/li><li>Cloud Scheduler\u5b9a\u671f\uff08\u5341\u5206\u9418\uff09\u767c\u9001\u9019\u500bmessage<\/li><li>Cloud Functions\u5403\u5230\u9019\u500bPubSub\u5c31\u88ab\u559a\u9192\u57f7\u884c<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u800c\u722c\u87f2\u7684config\u7531\u65bc\u6709credential\uff0c\u6240\u4ee5\u7531Secret Manager\u4f86\u5b58\uff0c\u7136\u5f8c\u7528mount\u7684\u65b9\u5f0f\u639b\u9032Cloud Functions\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Scheduler<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u9996\u5148\u6211\u5011\u9700\u8981\u4e00\u500b\u5b9a\u6642\u5668\u3002\u5e78\u904b\u7684\u662f\uff0cGCP\u672c\u8eab\u5c31\u6709\u63d0\u4f9bCloud Scheduler\u4f86\u63d0\u4f9b\u5b9a\u6642\u7684\u529f\u80fd\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"547\" height=\"368\" data-attachment-id=\"1084\" data-permalink=\"https:\/\/www.rayer.idv.tw\/blog\/?attachment_id=1084\" data-orig-file=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage.png?fit=547%2C368&amp;ssl=1\" data-orig-size=\"547,368\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage.png?fit=547%2C368&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage.png?resize=547%2C368&#038;ssl=1\" alt=\"\" class=\"wp-image-1084\" srcset=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage.png?w=547&amp;ssl=1 547w, https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage.png?resize=300%2C202&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage.png?resize=520%2C350&amp;ssl=1 520w\" sizes=\"auto, (max-width: 547px) 100vw, 547px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"558\" height=\"532\" data-attachment-id=\"1090\" data-permalink=\"https:\/\/www.rayer.idv.tw\/blog\/?attachment_id=1090\" data-orig-file=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-1.png?fit=558%2C532&amp;ssl=1\" data-orig-size=\"558,532\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-1.png?fit=558%2C532&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-1.png?resize=558%2C532&#038;ssl=1\" alt=\"\" class=\"wp-image-1090\" srcset=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-1.png?w=558&amp;ssl=1 558w, https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-1.png?resize=300%2C286&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-1.png?resize=367%2C350&amp;ssl=1 367w\" sizes=\"auto, (max-width: 558px) 100vw, 558px\" \/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Frequency\u57fa\u672c\u4e0a\u5c31\u662fCron\u7684format\uff0c\u6bd4\u65b9\u8aaa\u4f8b\u5b50\u4e2d\u7684<code>*\/15 * * * *<\/code>\u5c31\u662f\u6bcf15\u5206\u9418\u4e00\u6b21\u3002Target Type\u9078\u64c7<code>Pub\/Sub<\/code>\uff0c\u4e0b\u9762\u7684message\u9053\u662f\u96a8\u610f\uff0c\u7d66\u500b\u7a7aBody <code>{}<\/code>\u5c31\u597d\u3002\u4e0d\u904e\uff0c\u9019\u908a\u6709\u500b\u9650\u5236\uff0c\u5c31\u662fmessage \/ message attributes\u81f3\u5c11\u8981\u6709\u4e00\u500b\uff0c\u5c31\u96a8\u4fbf\u653e\u4e00\u500b\u5c31\u597d\u3002<code>Pub\/Sub topic<\/code>\u5247\u662f\u76f4\u63a5\u9078\u64c7Create a topic\u5c31\u597d\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Cloud Source Repositories<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Functions\u6709\u5f88\u591a\u7a2edeploy\u65b9\u5f0f\uff0c\u4e0d\u904e\u6700\u65b9\u4fbf\u7684\u65b9\u5f0f\u61c9\u8a72\u662f\u7528git\u3002\u4f46\u662f\uff0c\u4f7f\u7528git\u7684\u8a71\uff0c\u5fc5\u9808\u8981\u7528GCP\u81ea\u5df1\u7684Cloud Source Repositories(CSR)\u8a17\u7ba1\u3002\u5e78\u904b\u7684\u662f\uff0cCSR\u662f\u53ef\u4ee5\u4f5c\u70baGitHub\u7684mirror\u5b58\u5728\u7684\uff0c\u4e5f\u5c31\u662f\u8aaa\uff0c\u7576\u6211\u5011\u628acode push\u5230GitHub\u5f8c\uff0c\u5f88\u5feb\u8a72commit\u5c31\u6703\u88abmirror\u5230CSR\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"653\" height=\"328\" data-attachment-id=\"1086\" data-permalink=\"https:\/\/www.rayer.idv.tw\/blog\/?attachment_id=1086\" data-orig-file=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-2.png?fit=653%2C328&amp;ssl=1\" data-orig-size=\"653,328\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-2.png?fit=653%2C328&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-2.png?resize=653%2C328&#038;ssl=1\" alt=\"\" class=\"wp-image-1086\" srcset=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-2.png?w=653&amp;ssl=1 653w, https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-2.png?resize=300%2C151&amp;ssl=1 300w\" sizes=\"auto, (max-width: 653px) 100vw, 653px\" \/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u9996\u5148\uff0c\u5148\u9032\u5165CSR\uff0c\u6309\u4e0b\u53f3\u4e0a\u89d2\u7684Add Repository\uff0c\u7136\u5f8c\u9078\u64c7<strong>Connect External Repository<\/strong>\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"731\" height=\"632\" data-attachment-id=\"1088\" data-permalink=\"https:\/\/www.rayer.idv.tw\/blog\/?attachment_id=1088\" data-orig-file=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-3.png?fit=777%2C672&amp;ssl=1\" data-orig-size=\"777,672\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-3.png?fit=731%2C632&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-3.png?resize=731%2C632&#038;ssl=1\" alt=\"\" class=\"wp-image-1088\" srcset=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-3.png?w=777&amp;ssl=1 777w, https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-3.png?resize=300%2C259&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-3.png?resize=768%2C664&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-3.png?resize=405%2C350&amp;ssl=1 405w\" sizes=\"auto, (max-width: 731px) 100vw, 731px\" \/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u63a5\u4e0b\u4f86\u5c31\u662f\u884c\u79ae\u5982\u5100\uff0c\u9078\u64c7Project\uff0c\u9078\u64c7GitHub\u7576\u4f5cGit Provider\uff0c\u7136\u5f8c\u7d93\u904e\u4e00\u9023\u4e32\u7684Authorization\u5f8c\uff0c\u628a\u9019\u500brepo\u7d66Mirror\u9032\u4f86\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Secret Manager<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u7531\u65bc\u6211\u5011\u7684config\u5305\u542b\u4e86\u4e00\u4e9bcredential\uff0c\u6240\u4ee5\u6bd4\u8f03\u9069\u5408\u5b58\u653e\u5728Secret Manager\u5167\u3002\u9019\u6771\u897f\u4f7f\u7528\u8d77\u4f86\u975e\u5e38\u76f4\u89c0\uff0c\u5c31\u5efa\u7acb\u4e00\u500bkey\uff0c\u628aconfig\u585e\u9032\u53bb\u5c31\u597d<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"550\" height=\"609\" data-attachment-id=\"1092\" data-permalink=\"https:\/\/www.rayer.idv.tw\/blog\/?attachment_id=1092\" data-orig-file=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-4.png?fit=550%2C609&amp;ssl=1\" data-orig-size=\"550,609\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-4.png?fit=550%2C609&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-4.png?resize=550%2C609&#038;ssl=1\" alt=\"\" class=\"wp-image-1092\" srcset=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-4.png?w=550&amp;ssl=1 550w, https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-4.png?resize=271%2C300&amp;ssl=1 271w, https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-4.png?resize=316%2C350&amp;ssl=1 316w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ed6\u53ef\u4ee5upload\u6a94\u6848\uff0c\u6240\u4ee5\u751a\u81f3\u53ef\u4ee5\u628agcp credential(JSON)\u585e\u9032\u53bb\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Cloud Functions<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ed6\u57fa\u672c\u539f\u7406\u9084\u6eff\u7c21\u55ae\u7684\uff0c\u4e0d\u904e\u6709\u4e9b\u7709\u89d2\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>\u4ed6\u7684package name\u8981\u662fFQDN\u3002\u6bd4\u65b9\u8aaa<code>AppleTwNCCSpy<\/code>\u4e0d\u884c\uff0c<code>github.com\/Rayer\/AppleTwNCCSpy <\/code> \u624d\u884c\u3002<\/li><li>\u76ee\u524d\u4f86\u8b1b\u653e\u7f6eEntryPoint\u7684<code>.go<\/code> \u5fc5\u9808\u8981\u5728\u6700\u4e0a\u5c64\u3002\u5982\u679c\u662f\u653e\u5b50\u76ee\u9304\u7684\u8a71\uff0c\u7121\u8ad6\u8a72\u5b50\u76ee\u9304\u6709\u6c92\u6709\u7368\u7acb\u7684<code>go.mod<\/code>, \u90fd\u6703\u5728fetch dependency\u7684\u968e\u6bb5\u6709\u932f\u8aa4\u3002\u9019\u554f\u984c\u5f88\u96b1\u6666\uff0c\u5982\u679c\u4e0d\u60f3\u6d6a\u8cbb\u6642\u9593\u7684\u8a71\uff0c\u8acb\u52d9\u5fc5\u628a\u5b83\u653e\u5728\u6700\u4e0a\u5c64\u3002<\/li><li>\u6211\u6703\u5efa\u8b70\u5148\u63a8\u4e00\u500b\u7d55\u5c0d\u53ef\u4ee5\u904e\u7684\u7248\u672c\u518d\u6162\u6162\u6539\u3002Functions Deploy\u975e\u5e38\u9ebb\u7169\uff0c\u800c\u4e14\u6240\u6709\u8f38\u5165\u7684\u6578\u64da\u90fd\u8981\u6210\u529fdeploy\u624d\u6703\u5132\u5b58\u2014\u2014\u4ea6\u5373\uff0c\u5982\u679c\u4f60deploy failed\uff0c\u6240\u6709\u6771\u897f\u90fd\u8981\u91cd\u6253\uff01\u8d85\u7169\u7684 orz<br><\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u9996\u5148\uff0c\u5efa\u7acb\u4e00\u500b\u4efb\u4f55\u540d\u5b57\u7684<code>.go<\/code>\u6a94\u6848\uff0c\u88e1\u9762\u653e\u4e00\u500b\u9019\u7a2e\u7c3d\u540d\u7684function : <code>func Func(ctx context.Context, m PubSubMessage) error<\/code> \uff0c\u8a18\u5f97\u51fd\u6578\u540d\u7a31\u958b\u982d\u8981\u5927\u5bebexport\uff0c\u4e0d\u7136\u6703\u8b80\u53d6\u4e0d\u5230\u3002\u4e8b\u5be6\u4e0a\uff0c\u4ed6\u4e00\u958b\u59cb\u5efa\u7acb\u7684\u7bc4\u4f8b\u4e5f\u6703\u63d0\u4f9b\u9019\u500b\u7c3d\u540d\u7d66\u4f60\u53c3\u8003\u3002\u6211\u500b\u4eba\u662f\u5efa\u8b70\u958b\u4e00\u500b\u65b0\u7684branch\u628a\u5b83\u7d66push\u4e0a\u53bb\uff0c\u63a5\u4e0b\u4f86\u5c31\u53ef\u4ee5\u958b\u59cb\u8a2d\u5b9a\u4e86\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7136\u5f8c\u9032\u5165Cloud Functions\uff0c\u9078Create Function\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"547\" height=\"501\" data-attachment-id=\"1087\" data-permalink=\"https:\/\/www.rayer.idv.tw\/blog\/?attachment_id=1087\" data-orig-file=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-5.png?fit=547%2C501&amp;ssl=1\" data-orig-size=\"547,501\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-5.png?fit=547%2C501&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-5.png?resize=547%2C501&#038;ssl=1\" alt=\"\" class=\"wp-image-1087\" srcset=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-5.png?w=547&amp;ssl=1 547w, https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-5.png?resize=300%2C275&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-5.png?resize=382%2C350&amp;ssl=1 382w\" sizes=\"auto, (max-width: 547px) 100vw, 547px\" \/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Basics\u6c92\u5565\u597d\u6ce8\u610f\u7684\uff0c\u5c31Trigger Type\u9078\u64c7\u525b\u5efa\u7acb\u597d\u7684<code>Pub\/Sub<\/code>\u4ee5\u53caTopic\u9078\u64c7\u525b\u5efa\u7acb\u597d\u7684Topic\u5373\u53ef\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"552\" height=\"539\" data-attachment-id=\"1091\" data-permalink=\"https:\/\/www.rayer.idv.tw\/blog\/?attachment_id=1091\" data-orig-file=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-6.png?fit=552%2C539&amp;ssl=1\" data-orig-size=\"552,539\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-6.png?fit=552%2C539&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-6.png?resize=552%2C539&#038;ssl=1\" alt=\"\" class=\"wp-image-1091\" srcset=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-6.png?w=552&amp;ssl=1 552w, https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-6.png?resize=300%2C293&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-6.png?resize=358%2C350&amp;ssl=1 358w\" sizes=\"auto, (max-width: 552px) 100vw, 552px\" \/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Runtime\u5012\u662f\u96a8\u610f\uff0c\u8981\u662f\u5de5\u4f5cloading\u5f88\u4f4e\u7684\u8a71\u5efa\u8b70\u628aMemory\u9078\u4f4e\u4e00\u9ede\u3002\u50cf\u662f\u6211\u9019\u7a2eCrawler\u7684\u8a71\uff0c\u4e0b\u9762\u7684Autoscaling\u7684<code>min<\/code>\u8a2d\u5b9a0\uff0c<code>max<\/code>\u8a2d\u5b9a1\u662f\u6700\u597d\u7684\u3002\u6ce8\u610f\uff0c\u5982\u679cmin\u4e0d\u662f\u8a2d\u5b9a0\u7684\u8a71\uff0c\u6703\u4e00\u76f4\u6709\u4e00\u500binstance\u9577\u5728\u4e0a\u9762\uff0c\u5f88\u8cb4\uff01\u6709\u9019\u7a2e\u9700\u6c42\u7684\u8a71App Engine\u6216\u8005VM\u6703\u662f\u66f4\u597d\u7684\u9078\u64c7\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"535\" height=\"573\" data-attachment-id=\"1085\" data-permalink=\"https:\/\/www.rayer.idv.tw\/blog\/?attachment_id=1085\" data-orig-file=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-7.png?fit=535%2C573&amp;ssl=1\" data-orig-size=\"535,573\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-7.png?fit=535%2C573&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-7.png?resize=535%2C573&#038;ssl=1\" alt=\"\" class=\"wp-image-1085\" srcset=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-7.png?w=535&amp;ssl=1 535w, https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-7.png?resize=280%2C300&amp;ssl=1 280w, https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-7.png?resize=327%2C350&amp;ssl=1 327w\" sizes=\"auto, (max-width: 535px) 100vw, 535px\" \/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Secrets\u5c31\u662f\u91cd\u982d\u6232\u4e86\uff0c\u6211\u5011\u6703\u628aConfig\u5beb\u6210yaml\u653e\u5728Secret\u88e1\u9762\u3002\u8209\u4f8b\u4f86\u8aaa\uff0c\u6211\u5011Secret\u662f\u525b\u525b\u8a2d\u5b9a\u7684<code>DemoConfig<\/code> Reference Method\u9078\u64c7Mounted as volumn(\u5efa\u8b70\u4e0d\u8981\u7528env expose)\uff0cMount Path<code>\/secrets<\/code>, \u6700\u5f8c\u7684path\u9078\u64c7<code>\/secrets\/DemoConfig.yml<\/code> \u9019\u6a23\u8a2d\u5b9a\u7684\u8a71\uff0c\u6211\u5011\u5728function\u5c31\u53ef\u4ee5\u9019\u6a23\u5f97\u5230\u9019\u500b\u503c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"go\" class=\"language-go\">\tconfByte, err := ioutil.ReadFile(\"\/secrets\/DemoConfig.yml\")\n\tif err != nil {\n\t\treturn err\n\t}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u63a5\u4e0b\u4f86\u770b\u4f60\u8981\u7528json parse, yaml parse\u9084\u662fraw text\u5c31\u90fd\u53ef\u4ee5\u4e86\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6700\u5f8c\uff0c\u6700\u9ebb\u7169\u7684\u5730\u65b9\u4f86\u4e86<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"731\" height=\"301\" data-attachment-id=\"1089\" data-permalink=\"https:\/\/www.rayer.idv.tw\/blog\/?attachment_id=1089\" data-orig-file=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-8.png?fit=1442%2C594&amp;ssl=1\" data-orig-size=\"1442,594\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-8.png?fit=731%2C301&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-8.png?resize=731%2C301&#038;ssl=1\" alt=\"\" class=\"wp-image-1089\" srcset=\"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-8.png?w=1442&amp;ssl=1 1442w, https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-8.png?resize=300%2C124&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-8.png?resize=1024%2C422&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-8.png?resize=768%2C316&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage-8.png?resize=850%2C350&amp;ssl=1 850w\" sizes=\"auto, (max-width: 731px) 100vw, 731px\" \/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Runtime\u7576\u7136\u9078Go 1.16\uff0cSource Code\u6211\u662f\u5148\u5efa\u8b70\u5148\u9078\u64c7Inline Editor\u7136\u5f8c\u5b58\u4e00\u6b21\uff0c\u518d\u56de\u4f86\u6539\uff0c\u4e0d\u7136deploy\u7684\u8a71\u4f60\u525b\u6253\u7684\u6771\u897f\u90fd\u8981\u91cd\u6253\u4e00\u6b21\uff01\u5b58\u597d\u56de\u4f86\u4ee5\u5f8c\uff0cSource Code\u9078\u64c7Cloud Source Repository\uff0c\u53f3\u908a\u7684Repository\u7684\u540d\u5b57&#8230;\u8acb\u591a\u958b\u4e00\u500b\u7a97\u53bbCSR\uff0c\u628arepository name\u62f7\u8c9d\u56de\u4f86\u8cbc\u4e0a\uff0c\u9019\u908a\u6c92\u6709\u81ea\u52d5\u5b8c\u6210 &#8230; <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u9084\u8a18\u5f97\u6211\u5efa\u8b70\u55ce\uff1f\u628afunction\u5beb\u5728\u6839\u76ee\u9304\uff0c\u591a\u958b\u4e00\u500bbranch\uff0c\u6240\u4ee5\u9019\u908a\u5c31\u884c\u88e1\u5982\u5b9c\u7684\u9078Branch\uff0c\u586b\u5165\u4f60\u525b\u5beb\u597d\u7684branch name\uff0c\u7136\u5f8cDirectory with source code\u5c31\u7dad\u6301<code>\/<\/code>\uff0c\u6700\u5f8cEntry Point\u586b\u5165function name\uff0c\u6309\u4e0bdeploy! \u9806\u5229\u7684\u8a71\u61c9\u8a72\u5c31\u6703\u5efa\u7acb\u51fa\u4f86\u4e86\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Re-Deploy<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u76ee\u524d\u4f86\u8b1bcommand line\u9084\u7f3a\u4e86\u4e00\u4e9b\u6771\u897f\uff0c\u6240\u4ee5\u5f37\u70c8\u5efa\u8b70\u5148\u7528UI Deploy\u4e00\u6b21\u5f8c\uff0c\u518d\u7528command line redeploy\u3002\u4ee5\u6211\u81ea\u5df1\u7684\u4f8b\u5b50\u4f86\u8b1b \uff0c\u5982\u679c\u8981deploy from  git:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"script\" class=\"language-script\">gcloud functions deploy apple-ncc-crawler-dev --region=us-central1 --entry-point CrawlAndAnalyze --memory 128MB --runtime go116 --source \"https:\/\/source.developers.google.com\/projects\/iris-303620\/repos\/github_rayer_appletwnccspy\/moveable-aliases\/master\/paths\/\/\"\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u8981\u5f9elocal deploy\uff0c\u62ff\u6389&#8211;source\u6a19\u7c64\u5373\u53ef\u3002\u5176\u5be6deploy from local\u61c9\u8a72\u6bd4\u8f03\u65b9\u4fbf\uff0c\u53ea\u662fcommand line\u7f3a\u4e0d\u5c11\u8a2d\u5b9a\uff0c\u6bd4\u65b9\u8aaa\u76ee\u524dsecret-&gt;mount\u6c92\u8fa6\u6cd5\u5f9ecommand line\u53bb\u8a2d\u5b9a\uff08\u4f46\u662f\u5f88\u5999\u7684\u662f\uff0ccommand line\u6703\u544a\u8a34\u4f60\u76f8\u95dc\u8a0a\u606f\uff09\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Command deploy\u6709\u4e9b\u8981\u6ce8\u610f\u7684\u5730\u65b9\uff0c\u6700\u5751\u7684\u5c31\u662f<code>--source<\/code> \u9019\u500bparameter\u3002\u4ed6\u770b\u8d77\u4f86\u5f88\u50cf\u662f\u4e00\u500b<code>https<\/code>\u958b\u982d\u7684\u7db2\u5740\uff0c\u4e8b\u5be6\u4e0a\u4e0d\u662f\u3002\u6bd4\u65b9\u8aaa\uff0c\u4ed6\u662f<code>https:\/\/source.developers.google.com<\/code>\u958b\u982d\uff0c\u4e0d\u662fCSR\u7684\u7db2\u5740<code>https:\/\/source.cloud.google.com <\/code>\u3002\u6240\u4ee5\u6700\u4fdd\u96aa\u7684\u65b9\u6cd5\u5c31\u662f\u62f7\u8c9d\u9019\u689d\u4e00\u500b\u500b\u81ea\u5df1\u6539\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"script\" class=\"language-script\">https:\/\/source.developers.google.com\/projects\/&lt;ProjectID&gt;\/repos\/&lt;Repository\u540d\u5b57&gt;\/moveable-aliases\/&lt;Branch&gt;\/paths\/\/\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u9019\u6a23\u61c9\u8a72\u5c31\u53ef\u4ee5\u5927\u529f\u544a\u6210\u4e86\u3002\u5efa\u8b70\u628adeploy\u6307\u4ee4\u5beb\u5728project\u88e1\u9762\u4e00\u500b<code>.sh<\/code>\u88e1\u9762\u65b9\u4fbf\u4ee5\u5f8c\u4f7f\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u958b\u59cb\u628a\u8166\u7b4b\u52d5\u5230\u6bcf\u500b\u6708\u8981\u5403\u6389\u621120\u9382\u7684linode\uff0c\u770b\u770b\u80fd\u4e0d\u80fd\u7528Google Compute Platform\u4f86\u53d6\u4ee3\u6389\u55ae\u7d14\u7684VM\u3002GCP\u672c\u8eab\u6709\u63d0\u4f9bFree Tier, \u6240\u4ee5\u53ea\u8981\u5c0f\u5fc3\u5730\u63a7\u5236\u7528\u91cf\uff0c\u642c\u9077\u61c9\u8a72\u662f\u53ef\u4ee5\u7701\u4e0b\u4e00\u7b46\uff0c\u800c\u4e14\u4e5f\u53ef\u4ee5\u73a9\u73a9GCP\u7684\u4e00\u4e9b\u65b0\u529f\u80fd\u3002 \u9700\u6c42\u5206\u6790 \u6211\u9019\u6b21\u5148\u642c\u9077\u4e4b\u524d\u5beb\u7684\u4e00\u500b\u722c\u87f2\u670d\u52d9\uff0c\u9019\u500b\u722c\u87f2\u670d\u52d9\u61c9\u8a72\u662f\u6211\u73fe\u6709\u670d\u52d9\u88e1\u9762\u6700\u7c21\u55ae\u7684\u4e00\u500b\uff0c\u9996\u5148\u5148\u5206\u6790\u4e00\u4e0b\u4ed6\u6709\u4ec0\u9ebc\u7279\u6027\uff1a \u9700\u8981\u5b9a\u6642\u88ab\u559a\u9192\uff08\u8a2d\u8a08\u4e0a\u5927\u698210\u5206\u9418\u4e00\u6b21\u5c31\u5920\u4e86\uff09 \u9700\u8981\u4e00\u500b\u5730\u65b9\u5b58\u653e\u722c\u4e0b\u4f86\u7684\u5206\u6790\u8cc7\u6599 \u4e0d\u9700\u8981\u5be6\u9ad4\u4e0a\u7684Database \u7a0b\u5f0f\u672c\u9ad4\u76f8\u7576\u5c0f<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"link","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[38,84],"tags":[162,161,86,163],"class_list":["post-1093","post","type-post","status-publish","format-link","hentry","category-code","category-84","tag-cloud","tag-gcp","tag-golang","tag-serverless","post_format-post-format-link"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u5c07\u670d\u52d9\u9077\u79fb\u5230Google Cloud Functions - Fox Nest<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.rayer.idv.tw\/blog\/?p=1093\" \/>\n<meta property=\"og:locale\" content=\"zh_TW\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5c07\u670d\u52d9\u9077\u79fb\u5230Google Cloud Functions - Fox Nest\" \/>\n<meta property=\"og:description\" content=\"\u6700\u8fd1\u958b\u59cb\u628a\u8166\u7b4b\u52d5\u5230\u6bcf\u500b\u6708\u8981\u5403\u6389\u621120\u9382\u7684linode\uff0c\u770b\u770b\u80fd\u4e0d\u80fd\u7528Google Compute Platform\u4f86\u53d6\u4ee3\u6389\u55ae\u7d14\u7684VM\u3002GCP\u672c\u8eab\u6709\u63d0\u4f9bFree Tier, \u6240\u4ee5\u53ea\u8981\u5c0f\u5fc3\u5730\u63a7\u5236\u7528\u91cf\uff0c\u642c\u9077\u61c9\u8a72\u662f\u53ef\u4ee5\u7701\u4e0b\u4e00\u7b46\uff0c\u800c\u4e14\u4e5f\u53ef\u4ee5\u73a9\u73a9GCP\u7684\u4e00\u4e9b\u65b0\u529f\u80fd\u3002 \u9700\u6c42\u5206\u6790 \u6211\u9019\u6b21\u5148\u642c\u9077\u4e4b\u524d\u5beb\u7684\u4e00\u500b\u722c\u87f2\u670d\u52d9\uff0c\u9019\u500b\u722c\u87f2\u670d\u52d9\u61c9\u8a72\u662f\u6211\u73fe\u6709\u670d\u52d9\u88e1\u9762\u6700\u7c21\u55ae\u7684\u4e00\u500b\uff0c\u9996\u5148\u5148\u5206\u6790\u4e00\u4e0b\u4ed6\u6709\u4ec0\u9ebc\u7279\u6027\uff1a \u9700\u8981\u5b9a\u6642\u88ab\u559a\u9192\uff08\u8a2d\u8a08\u4e0a\u5927\u698210\u5206\u9418\u4e00\u6b21\u5c31\u5920\u4e86\uff09 \u9700\u8981\u4e00\u500b\u5730\u65b9\u5b58\u653e\u722c\u4e0b\u4f86\u7684\u5206\u6790\u8cc7\u6599 \u4e0d\u9700\u8981\u5be6\u9ad4\u4e0a\u7684Database \u7a0b\u5f0f\u672c\u9ad4\u76f8\u7576\u5c0f\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.rayer.idv.tw\/blog\/?p=1093\" \/>\n<meta property=\"og:site_name\" content=\"Fox Nest\" \/>\n<meta property=\"article:published_time\" content=\"2021-12-23T16:24:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-12-23T23:39:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage.png\" \/>\n<meta name=\"author\" content=\"Rayer\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Rayer\" \/>\n<meta name=\"twitter:site\" content=\"@Rayer\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005:\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rayer\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9810\u4f30\u95b1\u8b80\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\u9418\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.rayer.idv.tw\\\/blog\\\/?p=1093#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rayer.idv.tw\\\/blog\\\/?p=1093\"},\"author\":{\"name\":\"Rayer\",\"@id\":\"https:\\\/\\\/www.rayer.idv.tw\\\/blog\\\/#\\\/schema\\\/person\\\/498379badb270198fef0edd6b06a5bd7\"},\"headline\":\"\u5c07\u670d\u52d9\u9077\u79fb\u5230Google Cloud Functions\",\"datePublished\":\"2021-12-23T16:24:20+00:00\",\"dateModified\":\"2021-12-23T23:39:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.rayer.idv.tw\\\/blog\\\/?p=1093\"},\"wordCount\":296,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.rayer.idv.tw\\\/blog\\\/#\\\/schema\\\/person\\\/498379badb270198fef0edd6b06a5bd7\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rayer.idv.tw\\\/blog\\\/?p=1093#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rayer.idv.tw\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/12\\\/DraggedImage.png\",\"keywords\":[\"cloud\",\"gcp\",\"golang\",\"serverless\"],\"articleSection\":[\"\u5beb\u5bebCode\",\"\u6280\u8853\"],\"inLanguage\":\"zh-TW\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.rayer.idv.tw\\\/blog\\\/?p=1093#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.rayer.idv.tw\\\/blog\\\/?p=1093\",\"url\":\"https:\\\/\\\/www.rayer.idv.tw\\\/blog\\\/?p=1093\",\"name\":\"\u5c07\u670d\u52d9\u9077\u79fb\u5230Google Cloud Functions - Fox Nest\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rayer.idv.tw\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.rayer.idv.tw\\\/blog\\\/?p=1093#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rayer.idv.tw\\\/blog\\\/?p=1093#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rayer.idv.tw\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/12\\\/DraggedImage.png\",\"datePublished\":\"2021-12-23T16:24:20+00:00\",\"dateModified\":\"2021-12-23T23:39:07+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.rayer.idv.tw\\\/blog\\\/?p=1093#breadcrumb\"},\"inLanguage\":\"zh-TW\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.rayer.idv.tw\\\/blog\\\/?p=1093\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-TW\",\"@id\":\"https:\\\/\\\/www.rayer.idv.tw\\\/blog\\\/?p=1093#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.rayer.idv.tw\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/12\\\/DraggedImage.png?fit=547%2C368&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/www.rayer.idv.tw\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/12\\\/DraggedImage.png?fit=547%2C368&ssl=1\",\"width\":547,\"height\":368},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.rayer.idv.tw\\\/blog\\\/?p=1093#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9801\",\"item\":\"https:\\\/\\\/www.rayer.idv.tw\\\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5c07\u670d\u52d9\u9077\u79fb\u5230Google Cloud Functions\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.rayer.idv.tw\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.rayer.idv.tw\\\/blog\\\/\",\"name\":\"Fox Nest\",\"description\":\"\u6709\u6642\u5019\u7e3d\u60f3\u6709\u500b\u5730\u65b9\u653e\u653e\u96a8\u624b\u4e82\u5beb\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.rayer.idv.tw\\\/blog\\\/#\\\/schema\\\/person\\\/498379badb270198fef0edd6b06a5bd7\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.rayer.idv.tw\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-TW\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.rayer.idv.tw\\\/blog\\\/#\\\/schema\\\/person\\\/498379badb270198fef0edd6b06a5bd7\",\"name\":\"Rayer\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-TW\",\"@id\":\"https:\\\/\\\/i0.wp.com\\\/www.rayer.idv.tw\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/564120_490926324264770_332274456_n.jpg?fit=800%2C600&ssl=1\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.rayer.idv.tw\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/564120_490926324264770_332274456_n.jpg?fit=800%2C600&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/www.rayer.idv.tw\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/564120_490926324264770_332274456_n.jpg?fit=800%2C600&ssl=1\",\"width\":800,\"height\":600,\"caption\":\"Rayer\"},\"logo\":{\"@id\":\"https:\\\/\\\/i0.wp.com\\\/www.rayer.idv.tw\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/564120_490926324264770_332274456_n.jpg?fit=800%2C600&ssl=1\"},\"sameAs\":[\"https:\\\/\\\/www.rayer.idv.tw\",\"https:\\\/\\\/x.com\\\/Rayer\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5c07\u670d\u52d9\u9077\u79fb\u5230Google Cloud Functions - Fox Nest","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.rayer.idv.tw\/blog\/?p=1093","og_locale":"zh_TW","og_type":"article","og_title":"\u5c07\u670d\u52d9\u9077\u79fb\u5230Google Cloud Functions - Fox Nest","og_description":"\u6700\u8fd1\u958b\u59cb\u628a\u8166\u7b4b\u52d5\u5230\u6bcf\u500b\u6708\u8981\u5403\u6389\u621120\u9382\u7684linode\uff0c\u770b\u770b\u80fd\u4e0d\u80fd\u7528Google Compute Platform\u4f86\u53d6\u4ee3\u6389\u55ae\u7d14\u7684VM\u3002GCP\u672c\u8eab\u6709\u63d0\u4f9bFree Tier, \u6240\u4ee5\u53ea\u8981\u5c0f\u5fc3\u5730\u63a7\u5236\u7528\u91cf\uff0c\u642c\u9077\u61c9\u8a72\u662f\u53ef\u4ee5\u7701\u4e0b\u4e00\u7b46\uff0c\u800c\u4e14\u4e5f\u53ef\u4ee5\u73a9\u73a9GCP\u7684\u4e00\u4e9b\u65b0\u529f\u80fd\u3002 \u9700\u6c42\u5206\u6790 \u6211\u9019\u6b21\u5148\u642c\u9077\u4e4b\u524d\u5beb\u7684\u4e00\u500b\u722c\u87f2\u670d\u52d9\uff0c\u9019\u500b\u722c\u87f2\u670d\u52d9\u61c9\u8a72\u662f\u6211\u73fe\u6709\u670d\u52d9\u88e1\u9762\u6700\u7c21\u55ae\u7684\u4e00\u500b\uff0c\u9996\u5148\u5148\u5206\u6790\u4e00\u4e0b\u4ed6\u6709\u4ec0\u9ebc\u7279\u6027\uff1a \u9700\u8981\u5b9a\u6642\u88ab\u559a\u9192\uff08\u8a2d\u8a08\u4e0a\u5927\u698210\u5206\u9418\u4e00\u6b21\u5c31\u5920\u4e86\uff09 \u9700\u8981\u4e00\u500b\u5730\u65b9\u5b58\u653e\u722c\u4e0b\u4f86\u7684\u5206\u6790\u8cc7\u6599 \u4e0d\u9700\u8981\u5be6\u9ad4\u4e0a\u7684Database \u7a0b\u5f0f\u672c\u9ad4\u76f8\u7576\u5c0f","og_url":"https:\/\/www.rayer.idv.tw\/blog\/?p=1093","og_site_name":"Fox Nest","article_published_time":"2021-12-23T16:24:20+00:00","article_modified_time":"2021-12-23T23:39:07+00:00","og_image":[{"url":"https:\/\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage.png","type":"","width":"","height":""}],"author":"Rayer","twitter_card":"summary_large_image","twitter_creator":"@Rayer","twitter_site":"@Rayer","twitter_misc":{"\u4f5c\u8005:":"Rayer","\u9810\u4f30\u95b1\u8b80\u6642\u9593":"4 \u5206\u9418"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.rayer.idv.tw\/blog\/?p=1093#article","isPartOf":{"@id":"https:\/\/www.rayer.idv.tw\/blog\/?p=1093"},"author":{"name":"Rayer","@id":"https:\/\/www.rayer.idv.tw\/blog\/#\/schema\/person\/498379badb270198fef0edd6b06a5bd7"},"headline":"\u5c07\u670d\u52d9\u9077\u79fb\u5230Google Cloud Functions","datePublished":"2021-12-23T16:24:20+00:00","dateModified":"2021-12-23T23:39:07+00:00","mainEntityOfPage":{"@id":"https:\/\/www.rayer.idv.tw\/blog\/?p=1093"},"wordCount":296,"commentCount":0,"publisher":{"@id":"https:\/\/www.rayer.idv.tw\/blog\/#\/schema\/person\/498379badb270198fef0edd6b06a5bd7"},"image":{"@id":"https:\/\/www.rayer.idv.tw\/blog\/?p=1093#primaryimage"},"thumbnailUrl":"https:\/\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage.png","keywords":["cloud","gcp","golang","serverless"],"articleSection":["\u5beb\u5bebCode","\u6280\u8853"],"inLanguage":"zh-TW","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.rayer.idv.tw\/blog\/?p=1093#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.rayer.idv.tw\/blog\/?p=1093","url":"https:\/\/www.rayer.idv.tw\/blog\/?p=1093","name":"\u5c07\u670d\u52d9\u9077\u79fb\u5230Google Cloud Functions - Fox Nest","isPartOf":{"@id":"https:\/\/www.rayer.idv.tw\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.rayer.idv.tw\/blog\/?p=1093#primaryimage"},"image":{"@id":"https:\/\/www.rayer.idv.tw\/blog\/?p=1093#primaryimage"},"thumbnailUrl":"https:\/\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage.png","datePublished":"2021-12-23T16:24:20+00:00","dateModified":"2021-12-23T23:39:07+00:00","breadcrumb":{"@id":"https:\/\/www.rayer.idv.tw\/blog\/?p=1093#breadcrumb"},"inLanguage":"zh-TW","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.rayer.idv.tw\/blog\/?p=1093"]}]},{"@type":"ImageObject","inLanguage":"zh-TW","@id":"https:\/\/www.rayer.idv.tw\/blog\/?p=1093#primaryimage","url":"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage.png?fit=547%2C368&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2021\/12\/DraggedImage.png?fit=547%2C368&ssl=1","width":547,"height":368},{"@type":"BreadcrumbList","@id":"https:\/\/www.rayer.idv.tw\/blog\/?p=1093#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9801","item":"https:\/\/www.rayer.idv.tw\/blog"},{"@type":"ListItem","position":2,"name":"\u5c07\u670d\u52d9\u9077\u79fb\u5230Google Cloud Functions"}]},{"@type":"WebSite","@id":"https:\/\/www.rayer.idv.tw\/blog\/#website","url":"https:\/\/www.rayer.idv.tw\/blog\/","name":"Fox Nest","description":"\u6709\u6642\u5019\u7e3d\u60f3\u6709\u500b\u5730\u65b9\u653e\u653e\u96a8\u624b\u4e82\u5beb","publisher":{"@id":"https:\/\/www.rayer.idv.tw\/blog\/#\/schema\/person\/498379badb270198fef0edd6b06a5bd7"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rayer.idv.tw\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-TW"},{"@type":["Person","Organization"],"@id":"https:\/\/www.rayer.idv.tw\/blog\/#\/schema\/person\/498379badb270198fef0edd6b06a5bd7","name":"Rayer","image":{"@type":"ImageObject","inLanguage":"zh-TW","@id":"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2022\/02\/564120_490926324264770_332274456_n.jpg?fit=800%2C600&ssl=1","url":"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2022\/02\/564120_490926324264770_332274456_n.jpg?fit=800%2C600&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2022\/02\/564120_490926324264770_332274456_n.jpg?fit=800%2C600&ssl=1","width":800,"height":600,"caption":"Rayer"},"logo":{"@id":"https:\/\/i0.wp.com\/www.rayer.idv.tw\/blog\/wp-content\/uploads\/2022\/02\/564120_490926324264770_332274456_n.jpg?fit=800%2C600&ssl=1"},"sameAs":["https:\/\/www.rayer.idv.tw","https:\/\/x.com\/Rayer"]}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pacpZ9-hD","amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.rayer.idv.tw\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1093","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rayer.idv.tw\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rayer.idv.tw\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rayer.idv.tw\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rayer.idv.tw\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1093"}],"version-history":[{"count":9,"href":"https:\/\/www.rayer.idv.tw\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1093\/revisions"}],"predecessor-version":[{"id":1111,"href":"https:\/\/www.rayer.idv.tw\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1093\/revisions\/1111"}],"wp:attachment":[{"href":"https:\/\/www.rayer.idv.tw\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1093"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rayer.idv.tw\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1093"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rayer.idv.tw\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}