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