You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.4 KiB

  1. // 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. // +build appengine
  5. package internal
  6. import (
  7. "appengine"
  8. netcontext "golang.org/x/net/context"
  9. )
  10. func init() {
  11. appengineStandard = true
  12. }
  13. func DefaultVersionHostname(ctx netcontext.Context) string {
  14. c := fromContext(ctx)
  15. if c == nil {
  16. panic(errNotAppEngineContext)
  17. }
  18. return appengine.DefaultVersionHostname(c)
  19. }
  20. func Datacenter(_ netcontext.Context) string { return appengine.Datacenter() }
  21. func ServerSoftware() string { return appengine.ServerSoftware() }
  22. func InstanceID() string { return appengine.InstanceID() }
  23. func IsDevAppServer() bool { return appengine.IsDevAppServer() }
  24. func RequestID(ctx netcontext.Context) string {
  25. c := fromContext(ctx)
  26. if c == nil {
  27. panic(errNotAppEngineContext)
  28. }
  29. return appengine.RequestID(c)
  30. }
  31. func ModuleName(ctx netcontext.Context) string {
  32. c := fromContext(ctx)
  33. if c == nil {
  34. panic(errNotAppEngineContext)
  35. }
  36. return appengine.ModuleName(c)
  37. }
  38. func VersionID(ctx netcontext.Context) string {
  39. c := fromContext(ctx)
  40. if c == nil {
  41. panic(errNotAppEngineContext)
  42. }
  43. return appengine.VersionID(c)
  44. }
  45. func fullyQualifiedAppID(ctx netcontext.Context) string {
  46. c := fromContext(ctx)
  47. if c == nil {
  48. panic(errNotAppEngineContext)
  49. }
  50. return c.FullyQualifiedAppID()
  51. }