vegapokerbot/internal/integration/factory.go
2024-05-10 11:46:43 +03:00

19 lines
552 B
Go

package integration
import (
"gitea.neur0tx.site/Neur0toxine/vegapokerbot/internal/db/model"
"gitea.neur0tx.site/Neur0toxine/vegapokerbot/internal/integration/iface"
"gitea.neur0tx.site/Neur0toxine/vegapokerbot/internal/integration/null"
"gitea.neur0tx.site/Neur0toxine/vegapokerbot/internal/integration/redmine"
"go.uber.org/zap"
)
func New(dbModel model.Integration, log *zap.SugaredLogger) iface.Integration {
switch dbModel.Type {
case model.RedmineIntegration:
return redmine.New(dbModel.Params, log)
default:
return null.New()
}
}