2021-02-24 10:17:39 +00:00
|
|
|
package eventstore
|
|
|
|
|
|
|
|
import (
|
2022-12-15 09:40:13 +00:00
|
|
|
"time"
|
2021-02-24 10:17:39 +00:00
|
|
|
|
2023-02-27 21:36:43 +00:00
|
|
|
"github.com/zitadel/zitadel/internal/database"
|
2022-12-15 09:40:13 +00:00
|
|
|
"github.com/zitadel/zitadel/internal/eventstore/repository"
|
2022-04-26 23:01:45 +00:00
|
|
|
z_sql "github.com/zitadel/zitadel/internal/eventstore/repository/sql"
|
2022-02-14 16:22:30 +00:00
|
|
|
)
|
2021-02-24 10:17:39 +00:00
|
|
|
|
2022-12-15 09:40:13 +00:00
|
|
|
type Config struct {
|
|
|
|
PushTimeout time.Duration
|
2023-02-27 21:36:43 +00:00
|
|
|
Client *database.DB
|
2022-12-15 09:40:13 +00:00
|
|
|
|
|
|
|
repo repository.Repository
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestConfig(repo repository.Repository) *Config {
|
|
|
|
return &Config{repo: repo}
|
|
|
|
}
|
|
|
|
|
|
|
|
func Start(config *Config) (*Eventstore, error) {
|
|
|
|
config.repo = z_sql.NewCRDB(config.Client)
|
|
|
|
return NewEventstore(config), nil
|
2021-02-24 10:17:39 +00:00
|
|
|
}
|