Documentation ¶
Index ¶
- Variables
- type Repo
- 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) Parent() 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 Repository ¶
Repository returns a parent ReadRepo if there is one.
func (*Repo) FindAll ¶
FindAll implements the FindAll method of the eventhorizon.ReadRepo interface.
func (*Repo) SetEntityFactory ¶ added in v0.7.0
SetEntityFactory sets a factory function that creates concrete entity types.
Click to show internal directories.
Click to hide internal directories.