Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
func (*App) Close ¶
Close registers Closer component. Closer components are invoked during application Stop process.
func (*App) Init ¶
func (a *App) Init(i Initializer) *App
Init registers Initializer component. Initializer components are invoked during application Start process before Run happens.
func (*App) OnPanic ¶
OnPanic registers a callback function called in case of panic. Usually used to notify an external system (slack/email/sentry/etc) about unhandled issue in the running app. App instance can have only one panic callback. Every OnPanic invocation overwrites previously registered handler.
func (*App) Register ¶
Register is a shorthand function to register a component that implements multiple micron lifecycle hooks.
func (*App) Stop ¶
Stop will attempt to close all the components resources before exiting. It can be explicitly invoked whenever you want, otherwise it will be called automatically by the App instance in one of the following cases: - after all the runners return - when the context passed to Start is canceled - after a SIGNINT or SIGTERM signal is received
It's safe to call Stop multiple times, but only the first call will do the actual work. Please note that Stop is not guaranteed to be called in case of a panic.