luci: go.chromium.org/luci/appengine/gaemiddleware/standard Index | Files

package standard

import "go.chromium.org/luci/appengine/gaemiddleware/standard"

Package standard exposes a gaemiddleware Environment for Classic AppEngine.

Index

Package Files

env.go prpc.go urlfetch.go

func Base Uses

func Base() router.MiddlewareChain

Base returns a middleware chain to use for all GAE requests.

This middleware chain installs prod GAE services into the request context (via With), and wraps the request with a panic catcher and monitoring hooks.

func InstallHandlers Uses

func InstallHandlers(r *router.Router)

InstallHandlers installs handlers for framework routes using classic production services' default middleware.

See InstallHandlersWithMiddleware for more information.

func InstallHandlersWithMiddleware Uses

func InstallHandlersWithMiddleware(r *router.Router, base router.MiddlewareChain)

InstallHandlersWithMiddleware installs handlers for framework routes using classic production services.

These routes are needed for various services provided in Base context to work:

* Authentication related routes (gaeauth)
* Settings pages (gaesettings)
* Various housekeeping crons (tsmon, gaeconfig)
* Warmup (warmup)

They must be installed into a default module, but it is also safe to install them into a non-default module. This may be handy if you want to move cron handlers into a non-default module.

'base' is expected to be an Environment's Base() or its derivative. It must NOT do any interception of requests (e.g. checking and rejecting unauthenticated requests).

func With Uses

func With(c context.Context, req *http.Request) context.Context

With adds various production GAE LUCI services to the context.

Basically, it installs GAE-specific backends and caches for various subsystems to make them work in GAE environment.

One example is a backend for Logging: go.chromium.org/luci/common/logging. Logs emitted through a With() context go to GAE logs.

'Production' here means the services will use real GAE APIs (not mocks or stubs), so With should never be used from unit tests.

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