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