2020-05-20 14:28:08 +02:00
|
|
|
package notification
|
|
|
|
|
|
|
|
import (
|
2022-02-14 17:22:30 +01:00
|
|
|
"database/sql"
|
2021-12-16 15:21:37 +01:00
|
|
|
|
2020-05-20 14:28:08 +02:00
|
|
|
"github.com/caos/logging"
|
2022-02-16 16:49:17 +01:00
|
|
|
"github.com/caos/zitadel/internal/crypto"
|
2022-02-14 17:22:30 +01:00
|
|
|
"github.com/rakyll/statik/fs"
|
|
|
|
|
2021-02-23 15:13:04 +01:00
|
|
|
"github.com/caos/zitadel/internal/command"
|
2020-05-20 14:28:08 +02:00
|
|
|
sd "github.com/caos/zitadel/internal/config/systemdefaults"
|
|
|
|
"github.com/caos/zitadel/internal/notification/repository/eventsourcing"
|
2020-06-09 15:11:42 +02:00
|
|
|
_ "github.com/caos/zitadel/internal/notification/statik"
|
2022-02-14 17:22:30 +01:00
|
|
|
"github.com/caos/zitadel/internal/query"
|
2020-05-20 14:28:08 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
type Config struct {
|
|
|
|
Repository eventsourcing.Config
|
|
|
|
}
|
|
|
|
|
2022-02-16 16:49:17 +01:00
|
|
|
func Start(config Config, systemDefaults sd.SystemDefaults, command *command.Commands, queries *query.Queries, dbClient *sql.DB, assetsPrefix string, smtpPasswordEncAlg crypto.EncryptionAlgorithm) {
|
2020-06-09 15:11:42 +02:00
|
|
|
statikFS, err := fs.NewWithNamespace("notification")
|
2022-02-14 17:22:30 +01:00
|
|
|
logging.OnError(err).Panic("unable to start listener")
|
2020-06-09 15:11:42 +02:00
|
|
|
|
2022-02-16 16:49:17 +01:00
|
|
|
_, err = eventsourcing.Start(config.Repository, statikFS, systemDefaults, command, queries, dbClient, assetsPrefix, smtpPasswordEncAlg)
|
2022-02-14 17:22:30 +01:00
|
|
|
logging.OnError(err).Panic("unable to start app")
|
2020-05-20 14:28:08 +02:00
|
|
|
}
|