mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-29 19:17:49 +00:00
c5d6325897
* feat: change mail template to new query side * feat: adminapi message text * feat: adminapi message text * feat: adminapi message text * feat: message texts * feat: admin texts * feat: tests * feat: tests * feat: custom login text on adminapi * feat: custom login text * feat: custom login text * feat: message text prepare test * feat: login text texts * feat: custom login text * merge main * fix go.sum Co-authored-by: Livio Amstutz <livio.a@gmail.com>
56 lines
1.4 KiB
Go
56 lines
1.4 KiB
Go
package eventsourcing
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/caos/zitadel/internal/command"
|
|
"github.com/caos/zitadel/internal/eventstore/v1"
|
|
"github.com/caos/zitadel/internal/query"
|
|
|
|
"golang.org/x/text/language"
|
|
|
|
sd "github.com/caos/zitadel/internal/config/systemdefaults"
|
|
"github.com/caos/zitadel/internal/config/types"
|
|
es_spol "github.com/caos/zitadel/internal/eventstore/v1/spooler"
|
|
"github.com/caos/zitadel/internal/notification/repository/eventsourcing/spooler"
|
|
noti_view "github.com/caos/zitadel/internal/notification/repository/eventsourcing/view"
|
|
)
|
|
|
|
type Config struct {
|
|
DefaultLanguage language.Tag
|
|
Eventstore v1.Config
|
|
View types.SQL
|
|
Spooler spooler.SpoolerConfig
|
|
Domain string
|
|
}
|
|
|
|
type EsRepository struct {
|
|
spooler *es_spol.Spooler
|
|
}
|
|
|
|
func Start(conf Config, dir http.FileSystem, systemDefaults sd.SystemDefaults, command *command.Commands, queries *query.Queries, apiDomain string) (*EsRepository, error) {
|
|
es, err := v1.Start(conf.Eventstore)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
sqlClient, err := conf.View.Start()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
view, err := noti_view.StartView(sqlClient)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
spool := spooler.StartSpooler(conf.Spooler, es, view, sqlClient, command, queries, systemDefaults, dir, apiDomain)
|
|
|
|
return &EsRepository{
|
|
spool,
|
|
}, nil
|
|
}
|
|
|
|
func (repo *EsRepository) Health() error {
|
|
return nil
|
|
}
|