Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 prod | 5 package prod |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "time" | 8 "time" |
| 9 | 9 |
| 10 "github.com/luci/gae/service/info" | 10 "github.com/luci/gae/service/info" |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 return giImpl{ci} | 25 return giImpl{ci} |
| 26 }) | 26 }) |
| 27 } | 27 } |
| 28 | 28 |
| 29 type giImpl struct{ context.Context } | 29 type giImpl struct{ context.Context } |
| 30 | 30 |
| 31 func (g giImpl) AccessToken(scopes ...string) (token string, expiry time.Time, e rr error) { | 31 func (g giImpl) AccessToken(scopes ...string) (token string, expiry time.Time, e rr error) { |
| 32 return appengine.AccessToken(g, scopes...) | 32 return appengine.AccessToken(g, scopes...) |
| 33 } | 33 } |
| 34 func (g giImpl) AppID() string { | 34 func (g giImpl) AppID() string { |
| 35 » return appengine.AppID(g) | 35 » id := appengine.AppID(g) |
| 36 » if appengine.IsDevAppServer() { | |
| 37 » » id = "dev~" + id | |
|
dnj (Google)
2015/08/14 16:08:32
This primarily affected the key's namespace, which
| |
| 38 » } | |
| 39 » return id | |
| 36 } | 40 } |
| 37 func (g giImpl) GetNamespace() string { | 41 func (g giImpl) GetNamespace() string { |
| 38 return g.Value(namespaceCopyKey).(string) | 42 return g.Value(namespaceCopyKey).(string) |
| 39 } | 43 } |
| 40 func (g giImpl) Datacenter() string { | 44 func (g giImpl) Datacenter() string { |
| 41 return appengine.Datacenter(g) | 45 return appengine.Datacenter(g) |
| 42 } | 46 } |
| 43 func (g giImpl) DefaultVersionHostname() string { | 47 func (g giImpl) DefaultVersionHostname() string { |
| 44 return appengine.DefaultVersionHostname(g) | 48 return appengine.DefaultVersionHostname(g) |
| 45 } | 49 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 87 } | 91 } |
| 88 func (g giImpl) ServiceAccount() (string, error) { | 92 func (g giImpl) ServiceAccount() (string, error) { |
| 89 return appengine.ServiceAccount(g) | 93 return appengine.ServiceAccount(g) |
| 90 } | 94 } |
| 91 func (g giImpl) SignBytes(bytes []byte) (keyName string, signature []byte, err e rror) { | 95 func (g giImpl) SignBytes(bytes []byte) (keyName string, signature []byte, err e rror) { |
| 92 return appengine.SignBytes(g, bytes) | 96 return appengine.SignBytes(g, bytes) |
| 93 } | 97 } |
| 94 func (g giImpl) VersionID() string { | 98 func (g giImpl) VersionID() string { |
| 95 return appengine.VersionID(g) | 99 return appengine.VersionID(g) |
| 96 } | 100 } |
| OLD | NEW |