appengine: google.golang.org/appengine/internal Index | Files | Directories

package internal

import "google.golang.org/appengine/internal"

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

Package Files

api.go api_common.go app_id.go identity.go identity_vm.go internal.go main_vm.go metadata.go net.go transaction.go

Variables

var ErrConcurrentTransaction = errors.New("internal: concurrent transaction")
var NamespaceMods = make(map[string]func(m proto.Message, namespace string))

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.

func AppID Uses

func AppID(c netcontext.Context) string

AppID is the implementation of the wrapper function of the same name in ../identity.go. See that file for commentary.

func BackgroundContext Uses

func BackgroundContext() netcontext.Context

func Call Uses

func Call(ctx netcontext.Context, service, method string, in, out proto.Message) error

func ContextForTesting Uses

func ContextForTesting(req *http.Request) netcontext.Context

func Datacenter Uses

func Datacenter(ctx netcontext.Context) string

func DefaultTicket Uses

func DefaultTicket() string

DefaultTicket returns a ticket used for background context or dev_appserver.

func DefaultVersionHostname Uses

func DefaultVersionHostname(ctx netcontext.Context) string

func FullyQualifiedAppID Uses

func FullyQualifiedAppID(ctx netcontext.Context) string

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 IncomingHeaders Uses

func IncomingHeaders(ctx netcontext.Context) http.Header

func InstanceID Uses

func InstanceID() string

func IsAppEngine Uses

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 Uses

func IsDevAppServer() bool

func IsFlex Uses

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 Uses

func IsSecondGen() bool

IsStandard is the implementation of the wrapper function of the same name in ../appengine.go. See that file for commentary.

func IsStandard Uses

func IsStandard() bool

IsStandard is the implementation of the wrapper function of the same name in ../appengine.go. See that file for commentary.

func Logf Uses

func Logf(ctx netcontext.Context, level int64, format string, args ...interface{})

func Main Uses

func Main()

func ModuleName Uses

func ModuleName(_ netcontext.Context) string

func NamespaceFromContext Uses

func NamespaceFromContext(ctx netcontext.Context) string

func NamespacedContext Uses

func NamespacedContext(ctx netcontext.Context, namespace string) netcontext.Context

NamespacedContext wraps a Context to support namespaces.

func RegisterErrorCodeMap Uses

func RegisterErrorCodeMap(service string, m map[int32]string)

RegisterErrorCodeMap is called from API implementations to register their error code map. This should only be called from init functions.

func RegisterTestRequest Uses

func RegisterTestRequest(req *http.Request, apiURL *url.URL, decorate func(netcontext.Context) netcontext.Context) (*http.Request, func())

RegisterTestRequest registers the HTTP request req for testing, such that any API calls are sent to the provided URL. It returns a closure to delete the registration. It should only be used by aetest package.

func RegisterTimeoutErrorCode Uses

func RegisterTimeoutErrorCode(service string, code int32)

func RegisterTransactionSetter Uses

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 ReqContext Uses

func ReqContext(req *http.Request) netcontext.Context

func RequestID Uses

func RequestID(ctx netcontext.Context) string

func RunTransactionOnce Uses

func RunTransactionOnce(c netcontext.Context, f func(netcontext.Context) error, xg bool, readOnly bool, previousTransaction *pb.Transaction) (*pb.Transaction, error)

func ServerSoftware Uses

func ServerSoftware() string

func SetTestEnv Uses

func SetTestEnv() func()

SetTestEnv sets the env variables for testing background ticket in Flex.

func VersionID Uses

func VersionID(_ netcontext.Context) string

func WithAppIDOverride Uses

func WithAppIDOverride(ctx netcontext.Context, appID string) netcontext.Context

func WithCallOverride Uses

func WithCallOverride(ctx netcontext.Context, f CallOverrideFunc) netcontext.Context

func WithContext Uses

func WithContext(parent netcontext.Context, req *http.Request) netcontext.Context

func WithLogOverride Uses

func WithLogOverride(ctx netcontext.Context, f logOverrideFunc) netcontext.Context

type APIError Uses

type APIError struct {
    Service string
    Detail  string
    Code    int32 // API-specific error code
}

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.

func (*APIError) Error Uses

func (e *APIError) Error() string

func (*APIError) IsTimeout Uses

func (e *APIError) IsTimeout() bool

type CallError Uses

type CallError struct {
    Detail string
    Code   int32
    // TODO: Remove this if we get a distinguishable error code.
    Timeout bool
}

CallError is the type returned by appengine.Context's Call method when an API call fails in a generic way, such as RpcError::CAPABILITY_DISABLED.

func (*CallError) Error Uses

func (e *CallError) Error() string

func (*CallError) IsTimeout Uses

func (e *CallError) IsTimeout() bool

type CallOverrideFunc Uses

type CallOverrideFunc func(ctx netcontext.Context, service, method string, in, out proto.Message) error

Directories

PathSynopsis
aetestingPackage aetesting provides utilities for testing App Engine packages.
app_identity
base
blobstore
capability
channel
datastore
image
log
mail
memcache
modules
remote_api
search
socket
system
taskqueue
urlfetch
user
xmpp

Package internal imports 23 packages (graph) and is imported by 91 packages. Updated 2018-12-05. Refresh now. Tools for package owners.