feat: add Load/Unload lifecycle hooks to PluginRegistration

Enables runtime plugin disable/enable without CMS restart.
Load is called after registration succeeds; Unload on disable
with a 30-second context deadline.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Alex Dunmow 2026-05-02 22:28:49 +08:00
parent 334d79b4bf
commit 601718a309

View File

@ -1,6 +1,7 @@
package plugin
import (
"context"
"io/fs"
"net/http"
@ -38,6 +39,9 @@ type PluginRegistration struct {
DirectoryExtensions func() *DirectoryExtensions
MediaHooks MediaHooksProvider
Load func(deps ServiceDeps) error
Unload func(ctx context.Context) error
Dependencies []Dependency
Migrations func() fs.FS
Version string