mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-27 13:25:40 +00:00
move router to module New func
This commit is contained in:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user