2020-05-20 14:28:08 +02:00
|
|
|
package notification
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"github.com/caos/logging"
|
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/rakyll/statik/fs"
|
|
|
|
|
|
|
|
_ "github.com/caos/zitadel/internal/notification/statik"
|
2020-05-20 14:28:08 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
type Config struct {
|
|
|
|
Repository eventsourcing.Config
|
|
|
|
}
|
|
|
|
|
2021-02-24 11:17:39 +01:00
|
|
|
func Start(ctx context.Context, config Config, systemDefaults sd.SystemDefaults, command *command.Commands) {
|
2020-06-09 15:11:42 +02:00
|
|
|
statikFS, err := fs.NewWithNamespace("notification")
|
|
|
|
logging.Log("CONFI-7usEW").OnError(err).Panic("unable to start listener")
|
|
|
|
|
2021-02-08 11:30:30 +01:00
|
|
|
_, err = eventsourcing.Start(config.Repository, statikFS, systemDefaults, command)
|
2020-05-20 14:28:08 +02:00
|
|
|
logging.Log("MAIN-9uBxp").OnError(err).Panic("unable to start app")
|
|
|
|
}
|