ShutdownPlugins gracefully tears down registered plugins.
(ctx context.Context)
| 514 | |
| 515 | // ShutdownPlugins gracefully tears down registered plugins. |
| 516 | func (a *App) ShutdownPlugins(ctx context.Context) error { |
| 517 | for id, pl := range a.plugins { |
| 518 | if pl == nil { |
| 519 | continue |
| 520 | } |
| 521 | |
| 522 | if err := pl.Shutdown(ctx); err != nil { |
| 523 | return fmt.Errorf("shutdown plugin %q: %w", id, err) |
| 524 | } |
| 525 | } |
| 526 | |
| 527 | return nil |
| 528 | } |
| 529 | |
| 530 | // Config returns the application's active configuration. |
| 531 | func (a *App) Config() *config.Config { |