move router to module New func

This commit is contained in:
Joel Wetzell
2025-12-06 23:00:45 -06:00
parent 8d8347fc4d
commit 9a06949b5b
16 changed files with 30 additions and 93 deletions

View File

@@ -18,9 +18,9 @@ type HTTPClient struct {
func init() {
RegisterModule(ModuleRegistration{
Type: "net.http.client",
New: func(config config.ModuleConfig) (Module, error) {
New: func(config config.ModuleConfig, router *Router) (Module, error) {
return &HTTPClient{config: config}, nil
return &HTTPClient{config: config, router: router}, nil
},
})
}
@@ -33,10 +33,6 @@ func (hc *HTTPClient) Type() string {
return hc.config.Type
}
func (hc *HTTPClient) RegisterRouter(router *Router) {
hc.router = router
}
func (hc *HTTPClient) Run() error {
hc.client = &http.Client{