From 601718a30919ee908ef9910dc73f098864907d6e Mon Sep 17 00:00:00 2001 From: Alex Dunmow Date: Sat, 2 May 2026 22:28:49 +0800 Subject: [PATCH] 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 --- plugin/registration.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugin/registration.go b/plugin/registration.go index de2cc1f..cb8cf02 100644 --- a/plugin/registration.go +++ b/plugin/registration.go @@ -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