bootstrap

package
v2.0.33 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: Apache-2.0 Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(
	ctx context.Context,
	cancel context.CancelFunc,
	commonFlags flags.Common,
	serviceKey string,
	serviceConfig interfaces.Configuration,
	startupTimer startup.Timer,
	dic *di.Container,
	useSecretProvider bool,
	handlers []interfaces.BootstrapHandler)

Run bootstraps an application. It loads configuration and calls the provided list of handlers. Any long-running process should be spawned as a go routine in a handler. Handlers are expected to return immediately. Once all of the handlers are called this function will wait for any go routines spawned inside the handlers to exit before returning to the caller. It is intended that the caller stop executing on the return of this function.

Types

type Deferred

type Deferred func()

Deferred defines the signature of a function returned by RunAndReturnWaitGroup that should be executed via defer.

func RunAndReturnWaitGroup

func RunAndReturnWaitGroup(
	ctx context.Context,
	cancel context.CancelFunc,
	commonFlags flags.Common,
	serviceKey string,
	serviceConfig interfaces.Configuration,
	startupTimer startup.Timer,
	dic *di.Container,
	useSecretProvider bool,
	handlers []interfaces.BootstrapHandler) (*sync.WaitGroup, Deferred, bool)

RunAndReturnWaitGroup bootstraps an application. It loads configuration and calls the provided list of handlers. Any long-running process should be spawned as a go routine in a handler. Handlers are expected to return immediately. Once all of the handlers are called this function will return a sync.WaitGroup reference to the caller. It is intended that the caller take whatever additional action makes sense before calling Wait() on the returned reference to wait for the application to be signaled to stop (and the corresponding goroutines spawned in the various handlers to be stopped cleanly).

Jump to

Keyboard shortcuts

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