mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-14 03:54:21 +00:00
5811a7b6a5
* refactor(v2): init database package * refactor(v2): init eventstore package * add mock package * test query constructors * option based push analog to query
29 lines
491 B
Go
29 lines
491 B
Go
package postgres
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/zitadel/zitadel/internal/database"
|
|
"github.com/zitadel/zitadel/internal/v2/eventstore"
|
|
)
|
|
|
|
var (
|
|
_ eventstore.Pusher = (*Storage)(nil)
|
|
_ eventstore.Querier = (*Storage)(nil)
|
|
)
|
|
|
|
type Storage struct {
|
|
client *database.DB
|
|
}
|
|
|
|
func New(client *database.DB) *Storage {
|
|
return &Storage{
|
|
client: client,
|
|
}
|
|
}
|
|
|
|
// Health implements eventstore.Pusher.
|
|
func (s *Storage) Health(ctx context.Context) error {
|
|
return s.client.PingContext(ctx)
|
|
}
|