Go + App Engine

灬猜想灬

贡献于2013-05-26

字数:0 关键词: Go语言编程 Go

pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API Go + App Engine = Johan Euphrosine 2012315 pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API Johan Euphrosine Google App Engine profiles.google.com/proppy · · · · · pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API App Engine App Engine Google web pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API Go Runtime · · · pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API Hello Gopher! package gopher import ( "fmt" "net/http" ) // init func init() { // /hello URL http.HandleFunc("/hello", hello) } // hello HTTP “Hello Gopher!” func hello(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, "Hello, Gopher!") } pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API Hello App Engine! application: gopher version: 1 runtime: go api_version: go1beta handlers: - url: /images static_dir: images - url: /doc static_dir: doc - url: /.* script: _go_app $ dev_appserver.py myapp/ $ appcfg.py update myapp/ pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API Hello Gopher! pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API Hello hackernews! XML package gopher import ( "appengine" "appengine/urlfetch" "encoding/xml" "fmt" "net/http" "time" ) func init() { // /hackernews URL http.HandleFunc("/hackernews", hackernews) } pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API XML Go <link /> ... type HNFeed struct { Data HNFeedData `xml:"channel"` } type HNFeedData struct { Items []Item `xml:"item"` } type Item struct { Title string `xml:"title"` Url string `xml:"link"` } pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API func hackernewsItems(c appengine.Context) []Item { client := urlfetch.Client(c) resp, err := client.Get(HNFeedUrl) if err != nil { c.Errorf(" %s : %s", HNFeedUrl, err.Error()) return []Item{} } defer resp.Body.Close() decoder := xml.NewDecoder(resp.Body) var feed *HNFeed if err = decoder.Decode(&feed); err != nil { c.Errorf(" HNFeed : %s", err.Error()) return []Item{} } return feed.Data.Items } pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API func hackernews(w http.ResponseWriter, r *http.Request) { c := appengine.NewContext(r) w.Header().Add("Content-Type", "text/plain") for _, item := range hackernewsItems(c) { fmt.Fprintf(w, "%s: %s\n", item.Title, item.Url) } } pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API Hello Hacker News! pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API Hello proggit! JSON package gopher import ( "appengine" "appengine/urlfetch" "encoding/json" "fmt" "net/http" "time" ) func init() { // /proggit URL http.HandleFunc("/proggit", proggit) } pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API Json Go {"data": { "children": [ {"data": { "title": ... , "url": ...}}, ... type RedditFeed struct { Data RedditFeedData } type RedditFeedData struct { Items []RedditFeedItem `json:"children"` } type RedditFeedItem struct { Data Item } type Item struct { Title string `xml:"title"` Url string `xml:"link"` } pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API func proggitItems(c appengine.Context) []Item { client := urlfetch.Client(c) resp, err := client.Get(ProggitFeedUrl) if err != nil { c.Errorf(" %s : %s", ProggitFeedUrl, err.Error()) return []Item{} } defer resp.Body.Close() decoder := json.NewDecoder(resp.Body) var feed *RedditFeed if err = decoder.Decode(&feed); err != nil { c.Errorf(" RedditFeed : %s", err.Error()) return []Item{} } items := make([]Item, len(feed.Data.Items)) for i, item := range feed.Data.Items { items[i] = item.Data } return items } pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API func proggit(w http.ResponseWriter, r *http.Request) { c := appengine.NewContext(r) w.Header().Add("Content-Type", "text/plain") for _, item := range proggitItems(c) { fmt.Fprintf(w, "%s: %s\n", item.Title, item.Url) } } pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API Hello Proggit! pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API Progginator! func progginator(w http.ResponseWriter, r *http.Request) { c := appengine.NewContext(r) hnItems := hackernewsItems(c) pgItems := proggitItems(c) w.Header().Add("Content-Type", "text/plain") for _, item := range hnItems { fmt.Fprintf(w, "%s: %s\n", item.Title, item.Url) } for _, item := range pgItems { fmt.Fprintf(w, "%s: %s\n", item.Title, item.Url) } } pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API Progginator! 2012-03-15 04:17:59.148 hackernews: 261.695ms 2012-03-15 04:17:59.246 proggit: 97.961ms 2012-03-15 04:17:59.246 progginator: 359.822ms pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API func progginator_(w http.ResponseWriter, r *http.Request) { c := appengine.NewContext(r) results := make(chan []Item) go func() { results <- hackernewsItems(c) }() go func() { results <- proggitItems(c) }() w.Header().Add("Content-Type", "text/plain") for i := 0; i < 2; i++ { items := <-results for _, item := range items { fmt.Fprintf(w, "%s: %s\n", item.Title, item.Url) } } } pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API Progginator! 2012-03-15 04:18:03.804 proggit: 110.451ms 2012-03-15 04:18:03.887 hackernews: 193.751ms 2012-03-15 04:18:03.887 progginator_: 193.824ms pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API encoding/* ! Go runtime goroutine channel API · · · pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API css Task Queue ! fork : code.google.com/p/progginator · · · · · pdfcrowd.comopen in browser PRO version Are you a developer? Try out the HTML to PDF API ! := "code.google.com/appengine/docs/go/" := "golang.org" := "profiles.google.com/proppy" xslidian@guao.hk </div></article> <div id="reader-more"> <p class="title">下载文档,方便阅读与编辑</p> <p class="gray"> 文档的实际排版效果,会与网站的显示效果略有不同!!</p> <p class="download-info"> <span style="font-size: 14px;color: #888888">需要</span> <span style="font-size: 24px;">5</span> <span style="font-size: 14px;padding-right: 20px;color: #888888">金币</span> <a href="javascript:void(null);" onclick="JC.redirect('/create')" style="color: #cf6a07"> [ 分享文档获得金币 ] </a> <span class="fcff">0 人已下载</span> </p> <p> <a class="button-xd pure-button download buy circle80 fs30" href="javascript:void(null);" data-type="3" data-num="5" data-download="true"><i aria-hidden="true" class="fa fa-yen"> </i> 下载文档</a> </p> </div> <section class="mip-box mt10"> <section class="mip-box-heading"><h3> 相关文档</h3></section> <section class="mip-box-body"> <ul class="list-unstyled clearfix"> <li class="ellipsis"><a href="/pdf/1df45fca91f7439d890866ec977cd5e5.html"><i class="fa fa-file-word-o" aria-hidden="true"></i>  Go + App Engine</a></li> <li class="ellipsis"><a href="/pdf/dcd4ff763d114f84bfd874a9d605eeae.html"><i class="fa fa-file-word-o" aria-hidden="true"></i>  Google App Engine for Java</a></li> <li class="ellipsis"><a href="/pdf/f370dccba7814482830c3d8214134c54.html"><i class="fa fa-file-word-o" aria-hidden="true"></i>  Google App Engine入门</a></li> <li class="ellipsis"><a href="/pdf/d15b4bb9874d46b787547b20210b69d1.html"><i class="fa fa-file-word-o" aria-hidden="true"></i>  Google App Engine 入门教程</a></li> <li class="ellipsis"><a href="/pdf/7beb2196c97a48cbbf10caf3409c631c.html"><i class="fa fa-file-word-o" aria-hidden="true"></i>  Programming Google App Engine 编程手册</a></li> <li class="ellipsis"><a href="/pdf/6fa570150a6a4fa09d2db8f62e6b8238.html"><i class="fa fa-file-word-o" aria-hidden="true"></i>  Google App Engine 开发人员指南</a></li> <li class="ellipsis"><a href="/pdf/da25a13519ea4aa4b38f9e6aaa79f8b4.html"><i class="fa fa-file-word-o" aria-hidden="true"></i>  Google App Engine搭建个人代理服务器</a></li> <li class="ellipsis"><a href="/pdf/095d98d583184d7590307f0f9bbe7c65.html"><i class="fa fa-file-word-o" aria-hidden="true"></i>  爱奇艺基于Docker的App Engine实践</a></li> <li class="ellipsis"><a href="/pdf/2b0e7729dcd04e5fa5e661c7664a70df.html"><i class="fa fa-file-word-o" aria-hidden="true"></i>  Kylin OLAP Engine</a></li> <li class="ellipsis"><a href="/pdf/8169fd3ca62f4f99b24e40e3d9cc13be.html"><i class="fa fa-file-word-o" aria-hidden="true"></i>  Game Engine Architecture</a></li> </ul> </section> </section> <mip-fixed type="gototop"><mip-gototop threshold='300'><i class="fa fa-arrow-up" aria-hidden="true"></i></mip-gototop></mip-fixed> <!--mip 运行环境--> <script src="https://c.mipcdn.com/static/v1/mip.js"></script> <script src="https://c.mipcdn.com/static/v1/mip-sidebar/mip-sidebar.js"></script> <script src="https://c.mipcdn.com/extensions/platform/v1/mip-cambrian/mip-cambrian.js"></script> <script src="https://c.mipcdn.com/static/v1/mip-form/mip-form.js"></script> <script src="https://c.mipcdn.com/static/v1/mip-gototop/mip-gototop.js"></script> <script src="https://c.mipcdn.com/static/v1/mip-history/mip-history.js"></script> <script src="https://c.mipcdn.com/static/v1/mip-semi-fixed/mip-semi-fixed.js"></script> <script src="https://c.mipcdn.com/static/v1/mip-scrollbox/mip-scrollbox.js"></script> <script type="text/javascript" src="https://static.open-open.com/js/m-lib.js?v=1.01"></script> <script type="text/javascript" src="https://static.open-open.com/assets/jquery-confirm/jquery-confirm.js?v=4.7.0"></script> <script type="text/javascript" src="https://static.open-open.com/assets/jquery.modal.min.js?v=1.01"></script> <script type="text/javascript" src="https://static.open-open.com/js/m-base.js?v=1.01"></script> <script src="https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script> <script src="https://cdn.bootcss.com/jquery-modal/0.9.1/jquery.modal.min.js"></script> <script type="text/javascript" src="https://static.open-open.com/assets/jquery-confirm/jquery-confirm.js?v=3.3.2"></script> <script type="text/javascript" src="https://static.open-open.com/js/m-base.js?v=1.01"></script> <script src="https://static.open-open.com/js/v.js"></script> <script src="https://static.open-open.com/js/cload.js"></script> <script> var consume_gold_cost = 5, uId = "", cId = "30469", slug = "1df45fca91f7439d890866ec977cd5e5", title = "Go + App Engine", summary = "Go + App Engine"; var category_name = ""; var tagList = [{id:14319, name: "Go语言编程"}, {id:2622, name: "Go"}]; var num_page = "1"; var jc = {}, fav = []; $(function () { JC.init("", "30469", "pdf", 9, false); var a=$("#reader_content").cload({owidth:1129,oheight:800,oscale:0.366,offsetTop:-80,total:24, slug:"1df45fca91f7439d890866ec977cd5e5", api:"pdf/public/v1.0/pdf/load",num_can_preview:10}); window._bd_share_config = {"common": {"bdSnsKey": {}, "bdText": "", "bdMini": "2", "bdMiniList": false, "bdPic": "", "bdStyle": "0", "bdSize": "32"}, "share": {}}; with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'https://static.open-open.com/assets/baidushare/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)]; }); </script> </body> </html>