18 lines
362 B
Go
18 lines
362 B
Go
package integration
|
|
|
|
import (
|
|
"git.kocoder.xyz/kocoded/vt/fx/interfaces"
|
|
"go.uber.org/fx"
|
|
)
|
|
|
|
type IntegrationHandler struct {
|
|
}
|
|
|
|
func NewIntegrationHandler(integrations []interfaces.BasicIntegration, lc fx.Lifecycle) *IntegrationHandler {
|
|
for _, i := range integrations {
|
|
lc.Append(fx.StartStopHook(i.OnStart, i.OnStop))
|
|
}
|
|
|
|
return &IntegrationHandler{}
|
|
}
|