bumping knative.dev/serving 69caf07...ee022f4: > ee022f4 Update net-certmanager nightly (# 11691) > 0e98289 Update net-contour nightly (# 11690) > 73c1c0f Update net-istio nightly (# 11689) > 317cde6 Add support for emptyDir volume type (# 11669) > 770a40f Update boilerplate copyright year (# 11687) > 0b09cdd upgrade to latest dependencies (# 11671) > 9a84c20 Update net-kourier nightly (# 11685) > df276ab Update net-contour nightly (# 11684) > be47608 Update net-certmanager nightly (# 11683) > 026291c drop use of knative.dev/pkg metricskey in tests (# 11679) > c85d5fe Update net-certmanager nightly (# 11677) > 68da2ee Update net-contour nightly (# 11676) > 5bceb54 Update net-kourier nightly (# 11675) > 8076b8b Fix order of parameters in conformance README (# 11678) bumping knative.dev/eventing 0af15fd...25bd8ef: > 25bd8ef move source.StatsReporter from knative.dev/pkg (# 5594) > 1677431 upgrade to latest dependencies (# 5592) bumping knative.dev/networking e937f69...7390d8c: > 7390d8c upgrade to latest dependencies (# 464) > 8925a50 upgrade to latest dependencies (# 463) > d965698 upgrade to latest dependencies (# 462) bumping knative.dev/pkg 7d1b0f1...d9b7180: > d9b7180 minor bug when passing spoof options (# 2194) > 8931f82 remove source stats reporter (# 2193) > 591cb89 drop unused workflow (# 2192) > dbcf4cf removing default for KUBECONFIG to enable in cluster tests (# 2191) > 7764284 include OpenCensus in the list of metric backend (# 2189) > aff7376 drop stackdriver metrics and tracing exporters (# 2183) Signed-off-by: Knative Automation <automation@knative.team> |
||
|---|---|---|
| .. | ||
| internal | ||
| urlfetch | ||
| .travis.yml | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| README.md | ||
| appengine.go | ||
| appengine_vm.go | ||
| errors.go | ||
| go.mod | ||
| go.sum | ||
| identity.go | ||
| namespace.go | ||
| timeout.go | ||
| travis_install.sh | ||
| travis_test.sh | ||
README.md
Go App Engine packages
This repository supports the Go runtime on App Engine standard.
It provides APIs for interacting with App Engine services.
Its canonical import path is google.golang.org/appengine.
See https://cloud.google.com/appengine/docs/go/ for more information.
File issue reports and feature requests on the GitHub's issue tracker.
Upgrading an App Engine app to the flexible environment
This package does not work on App Engine flexible.
There are many differences between the App Engine standard environment and the flexible environment.
See the documentation on upgrading to the flexible environment.
Directory structure
The top level directory of this repository is the appengine package. It
contains the
basic APIs (e.g. appengine.NewContext) that apply across APIs. Specific API
packages are in subdirectories (e.g. datastore).
There is an internal subdirectory that contains service protocol buffers,
plus packages required for connectivity to make API calls. App Engine apps
should not directly import any package under internal.
Updating from legacy (import "appengine") packages
If you're currently using the bare appengine packages
(that is, not these ones, imported via google.golang.org/appengine),
then you can use the aefix tool to help automate an upgrade to these packages.
Run go get google.golang.org/appengine/cmd/aefix to install it.
1. Update import paths
The import paths for App Engine packages are now fully qualified, based at google.golang.org/appengine.
You will need to update your code to use import paths starting with that; for instance,
code importing appengine/datastore will now need to import google.golang.org/appengine/datastore.
2. Update code using deprecated, removed or modified APIs
Most App Engine services are available with exactly the same API. A few APIs were cleaned up, and there are some differences:
appengine.Contexthas been replaced with theContexttype fromgolang.org/x/net/context.- Logging methods that were on
appengine.Contextare now functions ingoogle.golang.org/appengine/log. appengine.Timeouthas been removed. Usecontext.WithTimeoutinstead.appengine.Datacenternow takes acontext.Contextargument.datastore.PropertyLoadSaverhas been simplified to use slices in place of channels.delay.Callnow returns an error.search.FieldLoadSavernow handles document metadata.urlfetch.Transportno longer has a Deadline field; set a deadline on thecontext.Contextinstead.aetestno longer declares its own Context type, and uses the standard one instead.taskqueue.QueueStatsno longer takes a maxTasks argument. That argument has been deprecated and unused for a long time.appengine.BackendHostnameandappengine.BackendInstancewere for the deprecated backends feature. Useappengine.ModuleHostnameandappengine.ModuleNameinstead.- Most of
appengine/fileand parts ofappengine/blobstoreare deprecated. Use Google Cloud Storage if the feature you require is not present in the new blobstore package. appengine/socketis not required on App Engine flexible environment / Managed VMs. Use the standardnetpackage instead.
Key Encode/Decode compatibiltiy to help with datastore library migrations
Key compatibility updates have been added to help customers transition from google.golang.org/appengine/datastore to cloud.google.com/go/datastore.
The EnableKeyConversion enables automatic conversion from a key encoded with cloud.google.com/go/datastore to google.golang.org/appengine/datastore key type.
Enabling key conversion
Enable key conversion by calling EnableKeyConversion(ctx) in the /_ah/start handler for basic and manual scaling or any handler in automatic scaling.
1. Basic or manual scaling
This start handler will enable key conversion for all handlers in the service.
http.HandleFunc("/_ah/start", func(w http.ResponseWriter, r *http.Request) {
datastore.EnableKeyConversion(appengine.NewContext(r))
})
2. Automatic scaling
/_ah/start is not supported for automatic scaling and /_ah/warmup is not guaranteed to run, so you must call datastore.EnableKeyConversion(appengine.NewContext(r))
before you use code that needs key conversion.
You may want to add this to each of your handlers, or introduce middleware where it's called.
EnableKeyConversion is safe for concurrent use. Any call to it after the first is ignored.