github.com/timstclair/heapster@v0.20.0-alpha1/Godeps/_workspace/src/google.golang.org/appengine/README.md (about) 1 # Go App Engine packages 2 3 [![Build Status](https://travis-ci.org/golang/appengine.svg)](https://travis-ci.org/golang/appengine) 4 5 This repository supports the Go runtime on App Engine, 6 including both classic App Engine and Managed VMs. 7 It provides APIs for interacting with App Engine services. 8 Its canonical import path is `google.golang.org/appengine`. 9 10 See https://cloud.google.com/appengine/docs/go/ 11 for more information. 12 13 File issue reports and feature requests on the [Google App Engine issue 14 tracker](https://code.google.com/p/googleappengine/issues/entry?template=Go%20defect). 15 16 ## Directory structure 17 The top level directory of this repository is the `appengine` package. It 18 contains the 19 basic APIs (e.g. `appengine.NewContext`) that apply across APIs. Specific API 20 packages are in subdirectories (e.g. `datastore`). 21 22 There is an `internal` subdirectory that contains service protocol buffers, 23 plus packages required for connectivity to make API calls. App Engine apps 24 should not directly import any package under `internal`. 25 26 ## Updating a Go App Engine app 27 28 This section describes how to update a traditional Go App Engine app to use 29 these packages. 30 31 ### 1. Update YAML files (Managed VMs only) 32 33 The `app.yaml` file (and YAML files for modules) should have these new lines added: 34 ``` 35 vm: true 36 manual_scaling: 37 instances: 1 38 ``` 39 See https://cloud.google.com/appengine/docs/go/modules/#Go_Instance_scaling_and_class for details. 40 41 ### 2. Update import paths 42 43 The import paths for App Engine packages are now fully qualified, based at `google.golang.org/appengine`. 44 You will need to update your code to use import paths starting with that; for instance, 45 code importing `appengine/datastore` will now need to import `google.golang.org/appengine/datastore`. 46 You can do that manually, or by running this command to recursively update all Go source files in the current directory: 47 (may require GNU sed) 48 ``` 49 sed -i '/"appengine/{s,"appengine,"google.golang.org/appengine,;s,appengine_,appengine/,}' \ 50 $(find . -name '*.go') 51 ``` 52 53 ### 3. Update code using deprecated, removed or modified APIs 54 55 Most App Engine services are available with exactly the same API. 56 A few APIs were cleaned up, and some are not available yet. 57 This list summarises the differences: 58 59 * `appengine.Context` has been replaced with the `Context` type from `golang.org/x/net/context`. 60 * Logging methods that were on `appengine.Context` are now functions in `google.golang.org/appengine/log`. 61 * `appengine.Timeout` has been removed. Use `context.WithTimeout` instead. 62 * `appengine.Datacenter` now takes a `context.Context` argument. 63 * `datastore.PropertyLoadSaver` has been simplified to use slices in place of channels. 64 * `delay.Call` now returns an error. 65 * `search.FieldLoadSaver` now handles document metadata. 66 * `urlfetch.Transport` no longer has a Deadline field; set a deadline on the 67 `context.Context` instead. 68 * `aetest` no longer declares its own Context type, and uses the standard one instead. 69 * `taskqueue.QueueStats` no longer takes a maxTasks argument. That argument has been 70 deprecated and unused for a long time. 71 * `appengine.BackendHostname` and `appengine.BackendInstance` were for the deprecated backends feature. 72 Use `appengine.ModuleHostname`and `appengine.ModuleName` instead. 73 * Most of `appengine/file` and parts of `appengine/blobstore` are deprecated. 74 Use [Google Cloud Storage](https://godoc.org/google.golang.org/cloud/storage) instead. 75 * `appengine/socket` is not required on Managed VMs. Use the standard `net` package instead.