add module loaded state

This commit is contained in:
Elijah Duffy
2025-05-30 16:40:31 -07:00
parent fc41a6ee5b
commit 891035cf93
2 changed files with 40 additions and 32 deletions

View File

@@ -13,6 +13,7 @@ type Module struct {
setup setupFn
teardown teardownFn
depends []string
loaded bool // loaded indicates if the module has been set up
}
// ModuleOpts contains user-exposed options when defining a module.
@@ -48,3 +49,8 @@ func (s *Module) Logger() *slog.Logger {
func (s *Module) Name() string {
return s.name
}
// Loaded returns whether the module has been set up.
func (s *Module) Loaded() bool {
return s.loaded
}