standard

package
v0.0.0-...-128afb8 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: Apache-2.0 Imports: 22 Imported by: 66

Documentation

Overview

Package standard exposes a gaemiddleware Environment for Classic AppEngine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base

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

func InstallHandlers(r *router.Router)

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

See InstallHandlersWithMiddleware for more information.

func InstallHandlersWithMiddleware

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

func With(ctx 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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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