mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 11:34:26 +00:00
389eb4a27a
* start v2 * start * run * some cleanup * remove v2 pkg again * simplify * webauthn * remove unused config * fix login path in Dockerfile * fix asset_generator.go * health handler * fix grpc web * refactor * merge * build new main.go * run new main.go * update logging pkg * fix error msg * update logging * cleanup * cleanup * go mod tidy * change localDevMode * fix customEndpoints * update logging * comments * change local flag to external configs * fix location generated go code * fix Co-authored-by: fforootd <florian@caos.ch>
48 lines
1.1 KiB
Go
48 lines
1.1 KiB
Go
package eventsourcing
|
|
|
|
import (
|
|
"context"
|
|
"database/sql"
|
|
|
|
"github.com/caos/zitadel/internal/admin/repository/eventsourcing/eventstore"
|
|
"github.com/caos/zitadel/internal/admin/repository/eventsourcing/spooler"
|
|
admin_view "github.com/caos/zitadel/internal/admin/repository/eventsourcing/view"
|
|
v1 "github.com/caos/zitadel/internal/eventstore/v1"
|
|
es_spol "github.com/caos/zitadel/internal/eventstore/v1/spooler"
|
|
"github.com/caos/zitadel/internal/static"
|
|
)
|
|
|
|
type Config struct {
|
|
SearchLimit uint64
|
|
Spooler spooler.SpoolerConfig
|
|
}
|
|
|
|
type EsRepository struct {
|
|
spooler *es_spol.Spooler
|
|
eventstore.AdministratorRepo
|
|
}
|
|
|
|
func Start(conf Config, static static.Storage, dbClient *sql.DB, loginPrefix string) (*EsRepository, error) {
|
|
es, err := v1.Start(dbClient)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
view, err := admin_view.StartView(dbClient)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
spool := spooler.StartSpooler(conf.Spooler, es, view, dbClient, static, loginPrefix)
|
|
|
|
return &EsRepository{
|
|
spooler: spool,
|
|
AdministratorRepo: eventstore.AdministratorRepo{
|
|
View: view,
|
|
},
|
|
}, nil
|
|
}
|
|
|
|
func (repo *EsRepository) Health(ctx context.Context) error {
|
|
return nil
|
|
}
|