blob: 4e979f45e34d53749779597286c98a73e8cd46bd [file] [log] [blame]
Zack Williamse940c7a2019-08-21 14:25:39 -07001// Copyright 2015 Google Inc. All rights reserved.
2// Use of this source code is governed by the Apache 2.0
3// license that can be found in the LICENSE file.
4
5// +build appengine
6
7package internal
8
9import (
10 "appengine"
11
12 netcontext "golang.org/x/net/context"
13)
14
15func init() {
16 appengineStandard = true
17}
18
19func DefaultVersionHostname(ctx netcontext.Context) string {
20 c := fromContext(ctx)
21 if c == nil {
22 panic(errNotAppEngineContext)
23 }
24 return appengine.DefaultVersionHostname(c)
25}
26
27func Datacenter(_ netcontext.Context) string { return appengine.Datacenter() }
28func ServerSoftware() string { return appengine.ServerSoftware() }
29func InstanceID() string { return appengine.InstanceID() }
30func IsDevAppServer() bool { return appengine.IsDevAppServer() }
31
32func RequestID(ctx netcontext.Context) string {
33 c := fromContext(ctx)
34 if c == nil {
35 panic(errNotAppEngineContext)
36 }
37 return appengine.RequestID(c)
38}
39
40func ModuleName(ctx netcontext.Context) string {
41 c := fromContext(ctx)
42 if c == nil {
43 panic(errNotAppEngineContext)
44 }
45 return appengine.ModuleName(c)
46}
47func VersionID(ctx netcontext.Context) string {
48 c := fromContext(ctx)
49 if c == nil {
50 panic(errNotAppEngineContext)
51 }
52 return appengine.VersionID(c)
53}
54
55func fullyQualifiedAppID(ctx netcontext.Context) string {
56 c := fromContext(ctx)
57 if c == nil {
58 panic(errNotAppEngineContext)
59 }
60 return c.FullyQualifiedAppID()
61}