Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: go/src/infra/gae/apps/helloworld/app.go

Issue 1153883002: go: infra/libs/* now live in luci-go. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: move the rest too Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « DEPS ('k') | go/src/infra/gae/libs/context/context.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package helloworld 5 package helloworld
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 "net/http" 9 "net/http"
10 "runtime" 10 "runtime"
11 11
12 "appengine" 12 "appengine"
13 "appengine/user" 13 "appengine/user"
14 14
15 "golang.org/x/net/context" 15 "golang.org/x/net/context"
16 16
17 » "infra/libs/logging" 17 » "github.com/luci/luci-go/common/logging"
18 » "infra/libs/logging/gaelogger" 18 » "github.com/luci/luci-go/common/logging/gaelogger"
19 ) 19 )
20 20
21 func init() { 21 func init() {
22 http.HandleFunc("/", requireLogin(rootHandler)) 22 http.HandleFunc("/", requireLogin(rootHandler))
23 } 23 }
24 24
25 func requireLogin(handler http.HandlerFunc) http.HandlerFunc { 25 func requireLogin(handler http.HandlerFunc) http.HandlerFunc {
26 return func(w http.ResponseWriter, r *http.Request) { 26 return func(w http.ResponseWriter, r *http.Request) {
27 c := appengine.NewContext(r) 27 c := appengine.NewContext(r)
28 u := user.Current(c) 28 u := user.Current(c)
(...skipping 19 matching lines...) Expand all
48 c := appengine.NewContext(r) 48 c := appengine.NewContext(r)
49 u := user.Current(c) 49 u := user.Current(c)
50 ctx := gaelogger.Use(context.Background(), c) 50 ctx := gaelogger.Use(context.Background(), c)
51 sayHi(ctx) 51 sayHi(ctx)
52 fmt.Fprintf(w, "Hello, %v!\n", u) 52 fmt.Fprintf(w, "Hello, %v!\n", u)
53 fmt.Fprintf(w, "GOROOT: %s\n", runtime.GOROOT()) 53 fmt.Fprintf(w, "GOROOT: %s\n", runtime.GOROOT())
54 fmt.Fprintf(w, "GOARCH: %s\n", runtime.GOARCH) 54 fmt.Fprintf(w, "GOARCH: %s\n", runtime.GOARCH)
55 fmt.Fprintf(w, "GOOS: %s\n", runtime.GOOS) 55 fmt.Fprintf(w, "GOOS: %s\n", runtime.GOOS)
56 fmt.Fprintf(w, "Compiler: %s\n", runtime.Compiler) 56 fmt.Fprintf(w, "Compiler: %s\n", runtime.Compiler)
57 } 57 }
OLDNEW
« no previous file with comments | « DEPS ('k') | go/src/infra/gae/libs/context/context.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698