Documentation ¶
Index ¶
- Variables
- type Repo
- func (r *Repo) Close() error
- func (r *Repo) Find(ctx context.Context, id uuid.UUID) (eh.Entity, error)
- func (r *Repo) FindAll(ctx context.Context) ([]eh.Entity, error)
- func (r *Repo) InnerRepo(ctx context.Context) eh.ReadRepo
- func (r *Repo) Remove(ctx context.Context, id uuid.UUID) error
- func (r *Repo) Save(ctx context.Context, entity eh.Entity) error
- func (r *Repo) SetEntityFactory(f func() eh.Entity)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrModelNotSet = errors.New("model not set")
ErrModelNotSet is when an model factory is not set on the Repo.
Functions ¶
This section is empty.
Types ¶
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
Repo implements an in memory repository of read models.
func IntoRepo ¶ added in v0.18.0
IntoRepo tries to convert a eh.ReadRepo into a Repo by recursively looking at inner repos. Returns nil if none was found.
func (*Repo) Close ¶ added in v0.18.0
Close implements the Close method of the eventhorizon.WriteRepo interface.
func (*Repo) FindAll ¶
FindAll implements the FindAll method of the eventhorizon.ReadRepo interface.
func (*Repo) InnerRepo ¶ added in v0.18.0
InnerRepo implements the InnerRepo method of the eventhorizon.ReadRepo interface.
func (*Repo) SetEntityFactory ¶ added in v0.18.0
SetEntityFactory sets a factory function that creates concrete entity types.
Click to show internal directories.
Click to hide internal directories.