info

package
v0.0.0-...-e6cee59 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2015 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFilters

func AddFilters(c context.Context, filts ...Filter) context.Context

AddFilters adds Interface filters to the context.

func Set

Set sets the current Interface object in the context. Useful for testing with a quick mock. This is just a shorthand SetFactory invocation to set a factory which always returns the same object.

func SetFactory

func SetFactory(c context.Context, gif Factory) context.Context

SetFactory sets the function to produce Interface instances, as returned by the Get method.

Types

type Certificate

type Certificate struct {
	KeyName string
	Data    []byte // PEM-encoded X.509 certificate
}

Certificate represents a public certificate for the app.

type Factory

type Factory func(context.Context) Interface

Factory is the function signature for factory methods compatible with SetFactory.

type Filter

type Filter func(context.Context, Interface) Interface

Filter is the function signature for a filter GI implementation. It gets the current GI implementation, and returns a new GI implementation backed by the one passed in.

type Interface

type Interface interface {
	AppID() string
	FullyQualifiedAppID() string
	GetNamespace() string

	Datacenter() string
	DefaultVersionHostname() string
	InstanceID() string
	IsDevAppServer() bool
	IsOverQuota(err error) bool
	IsTimeoutError(err error) bool
	ModuleHostname(module, version, instance string) (string, error)
	ModuleName() string
	RequestID() string
	ServerSoftware() string
	ServiceAccount() (string, error)
	VersionID() string

	Namespace(namespace string) (context.Context, error)

	AccessToken(scopes ...string) (token string, expiry time.Time, err error)
	PublicCertificates() ([]Certificate, error)
	SignBytes(bytes []byte) (keyName string, signature []byte, err error)
}

Interface is the interface for all of the package methods which normally would be in the 'appengine' package.

func Get

func Get(c context.Context) Interface

Get gets the Interface implementation from context.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL