add the concept of Id to a module

This commit is contained in:
Joel Wetzell
2025-11-18 19:13:14 -06:00
parent b3735ee713
commit 9ad60c8193
5 changed files with 61 additions and 18 deletions

View File

@@ -7,17 +7,20 @@ import (
)
type Module interface {
Id() string
Type() string
Run(context.Context) error
}
type ModuleConfig struct {
Id string `json:"id"`
Type string `json:"type"`
Params map[string]any `json:"params"`
}
type ModuleRegistration struct {
Type string `json:"type"`
New func(map[string]any) (Module, error)
New func(ModuleConfig) (Module, error)
}
func RegisterModule(mod ModuleRegistration) {