README
¶
EventHorizon with REDIS
Features
- EventStore
options := redis.UniversalOptions{
Addrs: "localhost",
DB: 1,
Password: "mypassword",
}
db := redis.NewUniversalClient(&options)
defer db.close()
store, err := ehre.NewEventStore(db)
Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCouldNotClearDB = errors.New("could not clear database")
ErrCouldNotClearDB is when the database could not be cleared.
View Source
var ErrCouldNotMarshalEvent = errors.New("could not marshal event")
ErrCouldNotMarshalEvent is when an event could not be marshaled into JSON.
View Source
var ErrCouldNotSaveAggregate = errors.New("could not save aggregate")
ErrCouldNotSaveAggregate is when an aggregate could not be saved.
View Source
var ErrCouldNotUnmarshalEvent = errors.New("could not unmarshal event")
ErrCouldNotUnmarshalEvent is when an event could not be unmarshalled into a concrete type.
View Source
var ErrVersionConflict = errors.New("can not create/update aggregate")
ErrConflictVersion is when a version conflict occurs when saving an aggregate.
View Source
var NewUUID = uuid.New
NewUUID for mocking in tests
Functions ¶
This section is empty.
Types ¶
type AggregateEvent ¶
type AggregateEvent struct { EventID uuid.UUID Namespace string AggregateID uuid.UUID AggregateType eh.AggregateType EventType eh.EventType RawEventData json.RawMessage Timestamp time.Time Version int Context map[string]interface{} MetaData map[string]interface{} RawMetaData json.RawMessage // contains filtered or unexported fields }
func (AggregateEvent) MarshalBinary ¶
func (a AggregateEvent) MarshalBinary() (data []byte, err error)
func (*AggregateEvent) UnmarshalBinary ¶
func (a *AggregateEvent) UnmarshalBinary(data []byte) error
type AggregateRecord ¶
type EventStore ¶
type EventStore struct {
// contains filtered or unexported fields
}
EventStore implements an eh.EventStore for PostgreSQL.
func NewEventStore ¶
func NewEventStore(db redis.UniversalClient) (*EventStore, error)
NewEventStore creates a new EventStore.
func (*EventStore) Clear ¶
func (s *EventStore) Clear(ctx context.Context) error
Clear clears the event storage.
func (*EventStore) Close ¶
func (s *EventStore) Close() error
Click to show internal directories.
Click to hide internal directories.