Documentation
¶
Index ¶
- Constants
- Variables
- type Base
- type EventStore
- func (s *EventStore) Clear(ctx context.Context) error
- func (s *EventStore) Close() error
- func (s *EventStore) Load(ctx context.Context, id uuid.UUID) (ret []eh.Event, err error)
- func (s *EventStore) LoadFrom(ctx context.Context, id uuid.UUID, version int) (ret []eh.Event, err error)
- func (s *EventStore) Save(ctx context.Context, events []eh.Event, originalVersion int) (err error)
- type Repo
- func (r *Repo) Close() (err error)
- func (r *Repo) Find(ctx context.Context, id uuid.UUID) (ret eh.Entity, err error)
- func (r *Repo) FindAll(ctx context.Context) (ret []eh.Entity, err error)
- func (r *Repo) InnerRepo(context.Context) eh.ReadRepo
- func (r *Repo) MkdirParents(file string) error
- func (r *Repo) Remove(ctx context.Context, id uuid.UUID) (err error)
- func (r *Repo) Save(ctx context.Context, entity eh.Entity) (err error)
- func (r *Repo) SetEntityFactory(f func() eh.Entity)
Constants ¶
View Source
const DefaultFilePerm os.FileMode = 0644
View Source
const DefaultFolderPerm os.FileMode = 0777
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 EventStore ¶
type EventStore struct {
*Base
}
func NewEventStore ¶
func NewEventStore(folder string) *EventStore
func (*EventStore) Close ¶
func (s *EventStore) Close() error
type Repo ¶
type Repo struct { *Base // contains filtered or unexported fields }
Repo implements an in memory repository of read models.
func (*Repo) FindAll ¶
FindAll implements the FindAll method of the eventhorizon.ReadRepo interface.
func (*Repo) MkdirParents ¶
func (*Repo) SetEntityFactory ¶
SetEntityFactory sets a factory function that creates concrete entity types.
Click to show internal directories.
Click to hide internal directories.