warmup

package
v0.0.0-...-04fcbae Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 6 Imported by: 27

Documentation

Overview

Package warmup allows to register hooks executed during the server warmup.

All registered hooks should be optional. The warmup stage can be skipped.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstallHandlersDeprecated

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

InstallHandlersDeprecated installs HTTP handlers for warmup /_ah/* routes.

It is deprecated. Do not use. On GAEv1 it is called by the framework code. On GAEv2 or on GKE use NewModuleFromFlags() and register the warmup module when starting the server.

func Register

func Register(name string, cb Callback)

Register adds a callback called during warmup.

func Warmup

func Warmup(c context.Context) error

Warmup executes all registered warmup callbacks, sequentially.

Doesn't abort on individual callback errors, just collects and returns them all.

Types

type Callback

type Callback func(c context.Context) error

Callback will be called during warmup.

Jump to

Keyboard shortcuts

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