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.

57 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 DefaultVersionHostname(ctx netcontext.Context) string {
  11. c := fromContext(ctx)
  12. if c == nil {
  13. panic(errNotAppEngineContext)
  14. }
  15. return appengine.DefaultVersionHostname(c)
  16. }
  17. func Datacenter(_ netcontext.Context) string { return appengine.Datacenter() }
  18. func ServerSoftware() string { return appengine.ServerSoftware() }
  19. func InstanceID() string { return appengine.InstanceID() }
  20. func IsDevAppServer() bool { return appengine.IsDevAppServer() }
  21. func RequestID(ctx netcontext.Context) string {
  22. c := fromContext(ctx)
  23. if c == nil {
  24. panic(errNotAppEngineContext)
  25. }
  26. return appengine.RequestID(c)
  27. }
  28. func ModuleName(ctx netcontext.Context) string {
  29. c := fromContext(ctx)
  30. if c == nil {
  31. panic(errNotAppEngineContext)
  32. }
  33. return appengine.ModuleName(c)
  34. }
  35. func VersionID(ctx netcontext.Context) string {
  36. c := fromContext(ctx)
  37. if c == nil {
  38. panic(errNotAppEngineContext)
  39. }
  40. return appengine.VersionID(c)
  41. }
  42. func fullyQualifiedAppID(ctx netcontext.Context) string {
  43. c := fromContext(ctx)
  44. if c == nil {
  45. panic(errNotAppEngineContext)
  46. }
  47. return c.FullyQualifiedAppID()
  48. }