diff --git a/internal/app/app.go b/internal/app/app.go index ee7720f..bd8fc74 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -132,9 +132,6 @@ func NewApp() *fx.App { settingsinterfaces.Module, notificationinterfaces.Module, exampleinterfaces.Module, - fx.Invoke(func(p *exampleinterfaces.ExamplePlugin) { - plugin.Register(p) - }), Module, ) } diff --git a/internal/modules/example/interfaces/plugin.go b/internal/modules/example/interfaces/plugin.go index dc1d1c4..6ca86d4 100644 --- a/internal/modules/example/interfaces/plugin.go +++ b/internal/modules/example/interfaces/plugin.go @@ -17,10 +17,11 @@ type ExamplePlugin struct { handler *Handler } -// New creates the example plugin. -// Call this during application bootstrap to register the plugin. +// New creates the example plugin and registers it in the global plugin registry. func New(handler *Handler) *ExamplePlugin { - return &ExamplePlugin{handler: handler} + p := &ExamplePlugin{handler: handler} + plugin.Register(p) + return p } func (p *ExamplePlugin) Metadata() plugin.Metadata {