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