• Stars
    star
    661
  • Rank 65,582 (Top 2 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created about 10 years ago
  • Updated 18 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Go App Engine packages

Go App Engine packages

CI Status

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.Context has been replaced with the Context type from context.
  • Logging methods that were on appengine.Context are now functions in google.golang.org/appengine/log.
  • appengine.Timeout has been removed. Use context.WithTimeout instead.
  • appengine.Datacenter now takes a context.Context argument.
  • datastore.PropertyLoadSaver has been simplified to use slices in place of channels.
  • delay.Call now returns an error.
  • search.FieldLoadSaver now handles document metadata.
  • urlfetch.Transport no longer has a Deadline field; set a deadline on the context.Context instead.
  • aetest no longer declares its own Context type, and uses the standard one instead.
  • taskqueue.QueueStats no longer takes a maxTasks argument. That argument has been deprecated and unused for a long time.
  • appengine.BackendHostname and appengine.BackendInstance were for the deprecated backends feature. Use appengine.ModuleHostnameand appengine.ModuleName instead.
  • Most of appengine/file and parts of appengine/blobstore are deprecated. Use Google Cloud Storage if the feature you require is not present in the new blobstore package.
  • appengine/socket is not required on App Engine flexible environment / Managed VMs. Use the standard net package instead.

Key Encode/Decode compatibility 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.

More Repositories

1

go

The Go programming language
Go
118,032
star
2

dep

Go dependency management tool experiment (deprecated)
Go
12,894
star
3

groupcache

groupcache is a caching and cache-filling library, intended as a replacement for memcached in many cases.
Go
12,622
star
4

protobuf

Go support for Google's protocol buffers
Go
9,463
star
5

mock

GoMock is a mocking framework for the Go programming language.
Go
9,199
star
6

tools

[mirror] Go Tools
Go
7,145
star
7

mobile

[mirror] Go on Mobile
Go
5,619
star
8

oauth2

Go OAuth2
Go
5,070
star
9

lint

[mirror] This is a linter for Go source code. (deprecated)
Go
3,978
star
10

vscode-go

Go extension for Visual Studio Code
TypeScript
3,673
star
11

glog

Leveled execution logs for Go
Go
3,498
star
12

proposal

Go Project Design Documents
Go
3,263
star
13

crypto

[mirror] Go supplementary cryptography libraries
Go
2,900
star
14

net

[mirror] Go supplementary network libraries
Go
2,781
star
15

example

Go example projects
Go
2,429
star
16

geo

S2 geometry library in Go
Go
1,622
star
17

tour

[mirror] A Tour of Go
Go
1,524
star
18

vgo

[mirror] Versioned Go Prototype
Go
1,523
star
19

snappy

The Snappy compression format in the Go programming language.
Go
1,463
star
20

sys

[mirror] Go packages for low-level interaction with the operating system
Go
1,229
star
21

leveldb

The LevelDB key-value database in the Go programming language.
Go
1,135
star
22

gddo

Go Doc Dot Org
Go
1,107
star
23

pkgsite

[mirror] Home of the pkg.go.dev website
Go
1,101
star
24

sync

[mirror] concurrency primitives
Go
830
star
25

gofrontend

Go compiler frontend (gccgo)
Go
823
star
26

exp

[mirror] Experimental and deprecated packages
Go
821
star
27

freetype

The Freetype font rasterizer in the Go programming language.
Go
758
star
28

text

[mirror] Go text processing support
Go
734
star
29

playground

[mirror] The Go Playground
Go
714
star
30

talks

Go talks
696
star
31

build

[mirror] Go's continuous build and release infrastructure (no stability promises)
Go
603
star
32

vulndb

[mirror] The Go Vulnerability Database
Go
535
star
33

image

[mirror] Go supplementary image libraries
Go
515
star
34

blog

[mirror] Go Blog (obsolete)
390
star
35

time

[mirror] Go supplementary time packages
Go
380
star
36

perf

[mirror] Performance measurement, storage, and analysis.
Go
363
star
37

website

[mirror] Home of the go.dev and golang.org websites
HTML
345
star
38

sublime-build

The official Sublime Text package for Go build system integration.
Python
341
star
39

vuln

[mirror] the database client and tools for the Go vulnerability database
Go
333
star
40

xerrors

Go
274
star
41

term

Go terminal and console support
Go
260
star
42

debug

[mirror] debugging tools
Go
225
star
43

mod

[mirror] Go module mechanics libraries
Go
183
star
44

dl

[mirror] go install golang.org/dl/go1.N@latest
Go
180
star
45

benchmarks

Benchmarks for the perf dashboard
Go
162
star
46

review

[mirror] Tool for working with Gerrit code reviews
Go
143
star
47

arch

[mirror] architecture code
Go
143
star
48

cwg

Community outreach Working Group
131
star
49

sublime-config

A library for Go environment configuration in Sublime Text
Python
84
star
50

govulncheck-action

[mirror] GitHub action for govulncheck
76
star
51

winstrap

Bootstrapping tools for windows builders
Go
48
star
52

scratch

[mirror] repository used for testing
Go
27
star
53

telemetry

[mirror] Go Telemetry services and libraries
Go
25
star
54

pkgsite-metrics

Code to serve pkg.go.dev/metrics [mirror]
Go
11
star
55

wiki

[mirror] Go Wiki
6
star
56

go-get-issue-15410

go-get-issue-15410
Go
3
star
57

.github

1
star
58

.allstar

1
star