app

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(logger *slog.Logger, configLoader func(target interface{}) error, modules []modulex.Module, opts ...Option) error

Run constructs a modulex.Manager, registers modules, and drives the full Init -> Start -> wait-for-shutdown -> Stop lifecycle.

Types

type Option

type Option func(*options)

Option configures Run.

func WithContext

func WithContext(ctx context.Context) Option

WithContext sets the base context Run derives its signal-aware lifecycle context from. Defaults to context.Background().

func WithManagerOptions

func WithManagerOptions(opts ...modulex.ManagerOption) Option

WithManagerOptions passes additional modulex.ManagerOption values through to modulex.NewManager.

func WithSetup

func WithSetup(fn func(*modulex.Manager) error) Option

WithSetup registers a hook that runs against the constructed Manager after NewManager but before modules are registered and initialized.

func WithShutdownTimeout

func WithShutdownTimeout(d time.Duration) Option

WithShutdownTimeout bounds the final StopModules call. Defaults to 15 seconds.

func WithSignals

func WithSignals(sig ...os.Signal) Option

WithSignals overrides the OS signals that trigger shutdown. Defaults to os.Interrupt and syscall.SIGTERM.

Jump to

Keyboard shortcuts

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