Go App Engine packages
Перейти к файлу
Dave Day 3d2bbb9da4 appengine/search: Introduce SortOptions for search.
Change-Id: Id3f777a0619acacd3906e22132b95f22e3ca585c
2014-10-03 15:19:38 +10:00
channel Add channel package. 2014-02-19 11:36:36 +11:00
datastore appengine/datastore: Add ByteString to allow short, indexed []byte values. 2014-09-02 15:23:53 +10:00
delay Change import paths from github.com/golang/appengine to google.golang.org/appengine. 2014-02-05 11:47:53 +11:00
demos Tighten up guestbook demo. 2014-09-02 15:26:48 +10:00
file Add file.DefaultBucketName function to get the default Google Cloud Storage bucket name for this app. 2014-09-15 21:18:09 -07:00
image Add image package. 2014-03-31 10:03:19 +11:00
internal Limit concurrent TCP connections to the API server. 2014-06-23 14:48:34 +10:00
log log: expose the InstanceID as per the python API's InstanceKey. 2014-03-05 14:45:53 +11:00
mail Change import paths from github.com/golang/appengine to google.golang.org/appengine. 2014-02-05 11:47:53 +11:00
memcache Run gofmt -s over all files 2014-06-10 12:22:59 +10:00
module Change import paths from github.com/golang/appengine to google.golang.org/appengine. 2014-02-05 11:47:53 +11:00
remote_api remote_api: allow localhost:port and fix app ID regexp 2014-05-15 14:36:15 +10:00
search appengine/search: Introduce SortOptions for search. 2014-10-03 15:19:38 +10:00
taskqueue appengine/taskqueue: Remove deprecated maxTasks argument to QueueStats. 2014-04-07 16:13:08 +10:00
urlfetch appengine/urlfetch: Avoid []byte copy for outgoing body when has a Bytes method. 2014-08-14 14:45:55 +10:00
user Rearrange how the user package gets its data. 2014-02-24 14:36:13 +11:00
xmpp Add xmpp package. 2014-02-10 15:52:13 +11:00
LICENSE Add LICENSE file. 2014-02-07 14:33:00 +11:00
README.md Add file.DefaultBucketName function to get the default Google Cloud Storage bucket name for this app. 2014-09-15 21:18:09 -07:00
appengine.go appengine: move GeoPoint from the search package to the main appengine one. 2014-03-27 20:49:36 +11:00
appengine_test.go appengine: move GeoPoint from the search package to the main appengine one. 2014-03-27 20:49:36 +11:00
errors.go Remove appengine.IsCapabilityDisabled. 2014-02-06 15:01:18 +11:00
identity.go Change import paths from github.com/golang/appengine to google.golang.org/appengine. 2014-02-05 11:47:53 +11:00
namespace.go Correctly apply namespace when nesting namespaced contexts. 2014-05-28 16:17:49 +10:00
namespace_test.go Add appengine.Namespace func. 2014-01-14 18:24:47 +11:00
timeout.go Change import paths from github.com/golang/appengine to google.golang.org/appengine. 2014-02-05 11:47:53 +11:00
timeout_test.go Change import paths from github.com/golang/appengine to google.golang.org/appengine. 2014-02-05 11:47:53 +11:00

README.md

Go App Engine for Managed VMs

This repository supports the Go runtime for Managed VMs on App Engine. It provides APIs for interacting with App Engine services. Its canonical import path is google.golang.org/appengine.

See https://developers.google.com/cloud/managed-vms for more information.

Directory structure

The top level directory of this repository is the appengine package. It contains the basic types (e.g. appengine.Context) that are used 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 a Go App Engine app

This section describes how to update a traditional Go App Engine app to run on Managed VMs.

1. Update YAML files

The app.yaml file (and YAML files for modules) should have these new lines added:

vm: true
manual_scaling:
  instances: 1

See https://developers.google.com/appengine/docs/go/modules/#Go_Instance_scaling_and_class for details.

2. Update import paths

The import paths for App Engine API packages need to be made relative to google.golang.org/appengine. You can do that manually, or by running this command to recursively update all Go source files in the current directory: (may require GNU sed)

sed -i '/"appengine/{s,"appengine,"google.golang.org/appengine,;s,appengine_,appengine/,}' \
  $(find . -name '*.go')

3. 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 some are not available yet. This list summarises the differences:

  • appengine.Datacenter now takes an appengine.Context argument.
  • datastore.PropertyLoadSaver has been simplified to use slices in place of channels.
  • search.FieldLoadSaver now handles document metadata.
  • taskqueue.QueueStats no longer takes a maxTasks argument. That argument has been deprecated and unused for a long time.
  • appengine/aetest, appengine/blobstore, appengine/cloudsql and appengine/runtime have not been ported yet.
  • appengine.BackendHostname and appengine.BackendInstance were for the deprecated backends feature. Use appengine.ModuleHostnameand appengine.ModuleName instead.
  • appengine.IsCapabilityDisabled and appengine/capability are obsolete.
  • Most of appengine/file is deprecated. Use Google Cloud Storage instead.
  • appengine/socket is deprecated. Use the standard net package instead.