2020-05-13 14:22:29 +02:00
|
|
|
package eventsourcing
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2021-06-11 13:20:39 +02:00
|
|
|
|
2023-10-19 12:19:10 +02:00
|
|
|
admin_handler "github.com/zitadel/zitadel/internal/admin/repository/eventsourcing/handler"
|
2022-04-27 01:01:45 +02:00
|
|
|
admin_view "github.com/zitadel/zitadel/internal/admin/repository/eventsourcing/view"
|
2023-02-27 22:36:43 +01:00
|
|
|
"github.com/zitadel/zitadel/internal/database"
|
2022-04-27 01:01:45 +02:00
|
|
|
"github.com/zitadel/zitadel/internal/static"
|
2020-05-13 14:22:29 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
type Config struct {
|
2023-10-19 12:19:10 +02:00
|
|
|
Spooler admin_handler.Config
|
2020-05-13 14:22:29 +02:00
|
|
|
}
|
|
|
|
|
2023-10-19 12:19:10 +02:00
|
|
|
func Start(ctx context.Context, conf Config, static static.Storage, dbClient *database.DB) error {
|
2022-02-14 17:22:30 +01:00
|
|
|
view, err := admin_view.StartView(dbClient)
|
2020-05-26 16:46:16 +02:00
|
|
|
if err != nil {
|
2023-10-19 12:19:10 +02:00
|
|
|
return err
|
2020-05-26 16:46:16 +02:00
|
|
|
}
|
|
|
|
|
2023-10-19 12:19:10 +02:00
|
|
|
admin_handler.Register(ctx, conf.Spooler, view, static)
|
2024-01-25 17:28:20 +01:00
|
|
|
admin_handler.Start(ctx)
|
2020-05-13 14:22:29 +02:00
|
|
|
|
2021-02-22 14:08:47 +01:00
|
|
|
return nil
|
2020-05-13 14:22:29 +02:00
|
|
|
}
|