Home | History | Annotate | Download | only in appengine
      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 standard*.
      6 It provides APIs for interacting with App Engine services.
      7 Its canonical import path is `google.golang.org/appengine`.
      8 
      9 See https://cloud.google.com/appengine/docs/go/
     10 for more information.
     11 
     12 File issue reports and feature requests on the [GitHub's issue
     13 tracker](https://github.com/golang/appengine/issues).
     14 
     15 ## Upgrading an App Engine app to the flexible environment
     16 
     17 This package does not work on *App Engine flexible*.
     18 
     19 There are many differences between the App Engine standard environment and
     20 the flexible environment.
     21 
     22 See the [documentation on upgrading to the flexible environment](https://cloud.google.com/appengine/docs/flexible/go/upgrading).
     23 
     24 ## Directory structure
     25 
     26 The top level directory of this repository is the `appengine` package. It
     27 contains the
     28 basic APIs (e.g. `appengine.NewContext`) that apply across APIs. Specific API
     29 packages are in subdirectories (e.g. `datastore`).
     30 
     31 There is an `internal` subdirectory that contains service protocol buffers,
     32 plus packages required for connectivity to make API calls. App Engine apps
     33 should not directly import any package under `internal`.
     34 
     35 ## Updating from legacy (`import "appengine"`) packages
     36 
     37 If you're currently using the bare `appengine` packages
     38 (that is, not these ones, imported via `google.golang.org/appengine`),
     39 then you can use the `aefix` tool to help automate an upgrade to these packages.
     40 
     41 Run `go get google.golang.org/appengine/cmd/aefix` to install it.
     42 
     43 ### 1. Update import paths
     44 
     45 The import paths for App Engine packages are now fully qualified, based at `google.golang.org/appengine`.
     46 You will need to update your code to use import paths starting with that; for instance,
     47 code importing `appengine/datastore` will now need to import `google.golang.org/appengine/datastore`.
     48 
     49 ### 2. Update code using deprecated, removed or modified APIs
     50 
     51 Most App Engine services are available with exactly the same API.
     52 A few APIs were cleaned up, and there are some differences:
     53 
     54 * `appengine.Context` has been replaced with the `Context` type from `golang.org/x/net/context`.
     55 * Logging methods that were on `appengine.Context` are now functions in `google.golang.org/appengine/log`.
     56 * `appengine.Timeout` has been removed. Use `context.WithTimeout` instead.
     57 * `appengine.Datacenter` now takes a `context.Context` argument.
     58 * `datastore.PropertyLoadSaver` has been simplified to use slices in place of channels.
     59 * `delay.Call` now returns an error.
     60 * `search.FieldLoadSaver` now handles document metadata.
     61 * `urlfetch.Transport` no longer has a Deadline field; set a deadline on the
     62   `context.Context` instead.
     63 * `aetest` no longer declares its own Context type, and uses the standard one instead.
     64 * `taskqueue.QueueStats` no longer takes a maxTasks argument. That argument has been
     65   deprecated and unused for a long time.
     66 * `appengine.BackendHostname` and `appengine.BackendInstance` were for the deprecated backends feature.
     67   Use `appengine.ModuleHostname`and `appengine.ModuleName` instead.
     68 * Most of `appengine/file` and parts of `appengine/blobstore` are deprecated.
     69   Use [Google Cloud Storage](https://godoc.org/cloud.google.com/go/storage) if the
     70   feature you require is not present in the new
     71   [blobstore package](https://google.golang.org/appengine/blobstore).
     72 * `appengine/socket` is not required on App Engine flexible environment / Managed VMs.
     73   Use the standard `net` package instead.
     74