Documentation ¶
Overview ¶
Package internal provides support for package appengine.
Programs should not use this package directly. Its API is not stable. Use packages appengine and appengine/* instead.
Index ¶
- Variables
- func AppID(c context.Context) string
- func Call(ctx context.Context, service, method string, in, out proto.Message) error
- func ContextForTesting(req *http.Request) context.Context
- func Datacenter(ctx context.Context) string
- func DefaultVersionHostname(ctx context.Context) string
- func FullyQualifiedAppID(ctx context.Context) string
- func IncomingHeaders(ctx context.Context) http.Header
- func InstanceID() string
- func IsAppEngine() bool
- func IsDevAppServer() bool
- func IsFlex() bool
- func IsSecondGen() bool
- func IsStandard() bool
- func Logf(ctx context.Context, level int64, format string, args ...interface{})
- func Main()
- func Middleware(next http.Handler) http.Handler
- func ModuleName(_ context.Context) string
- func NamespaceFromContext(ctx context.Context) string
- func NamespacedContext(ctx context.Context, namespace string) context.Context
- func RegisterErrorCodeMap(service string, m map[int32]string)
- func RegisterTestRequest(req *http.Request, apiURL *url.URL, appID string) *http.Request
- func RegisterTimeoutErrorCode(service string, code int32)
- func RegisterTransactionSetter(f interface{})
- func ReqContext(req *http.Request) context.Context
- func RequestID(ctx context.Context) string
- func RunTransactionOnce(c context.Context, f func(context.Context) error, xg bool, readOnly bool, ...) (*pb.Transaction, error)
- func ServerSoftware() string
- func SetTestEnv() func()
- func VersionID(_ context.Context) string
- func WithAppIDOverride(ctx context.Context, appID string) context.Context
- func WithCallOverride(ctx context.Context, f CallOverrideFunc) context.Context
- func WithContext(parent context.Context, req *http.Request) context.Context
- func WithLogOverride(ctx context.Context, f logOverrideFunc) context.Context
- type APIError
- type CallError
- type CallOverrideFunc
Constants ¶
This section is empty.
Variables ¶
var ErrConcurrentTransaction = errors.New("internal: concurrent transaction")
var MainPath string
MainPath stores the file path of the main package.
NamespaceMods is a map from API service to a function that will mutate an RPC request to attach a namespace. The function should be prepared to be called on the same message more than once; it should only modify the RPC request the first time.
Functions ¶
func AppID ¶
AppID is the implementation of the wrapper function of the same name in ../identity.go. See that file for commentary.
func Datacenter ¶
func DefaultVersionHostname ¶
func FullyQualifiedAppID ¶
FullyQualifiedAppID returns the fully-qualified application ID. This may contain a partition prefix (e.g. "s~" for High Replication apps), or a domain prefix (e.g. "example.com:").
func InstanceID ¶
func InstanceID() string
func IsAppEngine ¶
func IsAppEngine() bool
IsAppEngine is the implementation of the wrapper function of the same name in ../appengine.go. See that file for commentary.
func IsDevAppServer ¶
func IsDevAppServer() bool
func IsFlex ¶
func IsFlex() bool
IsFlex is the implementation of the wrapper function of the same name in ../appengine.go. See that file for commentary.
func IsSecondGen ¶
func IsSecondGen() bool
IsSecondGen is the implementation of the wrapper function of the same name in ../appengine.go. See that file for commentary.
func IsStandard ¶
func IsStandard() bool
IsStandard is the implementation of the wrapper function of the same name in ../appengine.go. See that file for commentary.
func Middleware ¶ added in v2.0.3
Middleware wraps an http handler so that it can make GAE API calls
func ModuleName ¶
func NamespaceFromContext ¶
func NamespacedContext ¶
NamespacedContext wraps a Context to support namespaces.
func RegisterErrorCodeMap ¶
RegisterErrorCodeMap is called from API implementations to register their error code map. This should only be called from init functions.
func RegisterTestRequest ¶
RegisterTestRequest registers the HTTP request req for testing, such that any API calls are sent to the provided URL. It should only be used by test code or test helpers like aetest.
func RegisterTransactionSetter ¶
func RegisterTransactionSetter(f interface{})
RegisterTransactionSetter registers a function that sets transaction information in a protocol buffer message. f should be a function with two arguments, the first being a protocol buffer type, and the second being *datastore.Transaction.
func RunTransactionOnce ¶
func ServerSoftware ¶
func ServerSoftware() string
func SetTestEnv ¶
func SetTestEnv() func()
SetTestEnv sets the env variables for testing background ticket in Flex.
func WithCallOverride ¶
func WithCallOverride(ctx context.Context, f CallOverrideFunc) context.Context
Types ¶
type APIError ¶
APIError is the type returned by appengine.Context's Call method when an API call fails in an API-specific way. This may be, for instance, a taskqueue API call failing with TaskQueueServiceError::UNKNOWN_QUEUE.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package aetesting provides utilities for testing App Engine packages.
|
Package aetesting provides utilities for testing App Engine packages. |