vegapokerbot/internal/integration/factory.go

19 lines
552 B
Go
Raw Normal View History

2024-05-07 21:49:09 +03:00
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"
2024-05-10 11:46:43 +03:00
"go.uber.org/zap"
2024-05-07 21:49:09 +03:00
)
2024-05-10 11:46:43 +03:00
func New(dbModel model.Integration, log *zap.SugaredLogger) iface.Integration {
2024-05-07 21:49:09 +03:00
switch dbModel.Type {
case model.RedmineIntegration:
2024-05-10 11:46:43 +03:00
return redmine.New(dbModel.Params, log)
2024-05-07 21:49:09 +03:00
default:
return null.New()
}
}