add system config (#71)

This commit is contained in:
Fabi
2020-04-23 10:43:39 +02:00
committed by GitHub
parent 8464cfa4fe
commit ff11cdba40
8 changed files with 42 additions and 30 deletions

View File

@@ -2,8 +2,8 @@ package eventsourcing
import (
"context"
sd "github.com/caos/zitadel/internal/config/systemdefaults"
"github.com/caos/zitadel/internal/crypto"
es_int "github.com/caos/zitadel/internal/eventstore"
es_proj "github.com/caos/zitadel/internal/project/repository/eventsourcing"
)
@@ -12,8 +12,6 @@ type Config struct {
Eventstore es_int.Config
//View view.ViewConfig
//Spooler spooler.SpoolerConfig
PasswordSaltCost int
ClientSecretGenerator crypto.GeneratorConfig
}
type EsRepository struct {
@@ -21,7 +19,7 @@ type EsRepository struct {
ProjectRepo
}
func Start(conf Config) (*EsRepository, error) {
func Start(conf Config, systemDefaults sd.SystemDefaults) (*EsRepository, error) {
es, err := es_int.Start(conf.Eventstore)
if err != nil {
return nil, err
@@ -38,11 +36,9 @@ func Start(conf Config) (*EsRepository, error) {
//spool := spooler.StartSpooler(conf.Spooler)
project, err := es_proj.StartProject(es_proj.ProjectConfig{
Eventstore: es,
Cache: conf.Eventstore.Cache,
PasswordSaltCost: conf.PasswordSaltCost,
ClientSecretGenerator: conf.ClientSecretGenerator,
})
Eventstore: es,
Cache: conf.Eventstore.Cache,
}, systemDefaults)
if err != nil {
return nil, err
}