Documentation ¶
Overview ¶
Package prod provides an implementation of services/* which backs to AppEngine Classic (Go version <=1.11).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var RemoteAPIScopes = []string{
"https://www.googleapis.com/auth/appengine.apis",
"https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/cloud.platform",
}
RemoteAPIScopes is the set of OAuth2 scopes needed for Remote API access.
Functions ¶
func Use ¶
Use adds production implementations for all the gae services to the context. The implementations are all backed by the real appengine SDK functionality.
The services added are:
- github.com/luci-go/common/logging
- go.chromium.org/luci/gae/service/datastore
- go.chromium.org/luci/gae/service/info
- go.chromium.org/luci/gae/service/mail
- go.chromium.org/luci/gae/service/memcache
- go.chromium.org/luci/gae/service/module
- go.chromium.org/luci/gae/service/taskqueue
- go.chromium.org/luci/gae/service/urlfetch
- go.chromium.org/luci/gae/service/user
These can be retrieved with the <service>.Get functions.
It is important to note that this DOES NOT install the AppEngine SDK into the supplied Context. In general, using the raw AppEngine SDK to access a service that is covered by luci/gae is dangerous, leading to a number of potential pitfalls including inconsistent transaction management and data corruption.
Users who wish to access the raw AppEngine SDK must derive their own AppEngine Context at their own risk.
func UseBackground ¶
UseBackground is the same as Use except that it activates production implementations which aren't associated with any particular request.
This is only available on Managed VMs.
It is important to note that this DOES NOT install the AppEngine SDK into the supplied Context. See the warning in Use for more information.
func UseRemote ¶
UseRemote is the same as Use, except that it lets you attach a context to a remote host using the Remote API feature. See the docs for the prerequisites.
docs: https://cloud.google.com/appengine/docs/go/tools/remoteapi
inOutCtx will be replaced with the new, derived context, if err is nil, otherwise it's unchanged and continues to be safe-to-use.
If client is nil, this will use create a new client, and will try to be clever about it:
If you're creating a remote context FROM AppEngine, this will use urlfetch.Transport. This can be used to allow app-to-app remote_api control.
If host starts with "localhost", this will create a regular http.Client with a cookiejar, and call the _ah/login API to log in as an admin with the user "admin@example.com".
Otherwise, it will create a Google OAuth2 client with the following scopes:
It is important to note that this DOES NOT install the AppEngine SDK into the supplied Context. See the warning in Use for more information.
Types ¶
This section is empty.
Notes ¶
Bugs ¶
*datastore.Key objects have their AppID dropped when this package
converts them internally to use with the underlying datastore. In practice this shouldn't be much of an issue, since you normally have no control over the AppID field of a Key anyway (aside from deserializing one directly from a proto).
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package constraints contains production datastore constraints.
|
Package constraints contains production datastore constraints. |