Documentation
¶
Index ¶
- type EventStore
- func (s EventStore) AppendTo(ctx context.Context, streamName string, events []*messages.Event) error
- func (s EventStore) Create(ctx context.Context, stream *eventstore.Stream) error
- func (s EventStore) Delete(ctx context.Context, streamName string) error
- func (s EventStore) FetchStreamMetadata(ctx context.Context, streamName string) (eventstore.StreamMetadata, error)
- func (s EventStore) FetchStreamNames(ctx context.Context, filter string, matcher eventstore.MetadataMatcher, ...) ([]string, error)
- func (s EventStore) FetchStreamNamesRegex(ctx context.Context, filter string, matcher eventstore.MetadataMatcher, ...) ([]string, error)
- func (s EventStore) Load(ctx context.Context, streamName string, from, count uint64, ...) eventstore.StreamIterator
- func (s EventStore) LoadReverse(ctx context.Context, streamName string, from, count uint64, ...) eventstore.StreamIterator
- func (s EventStore) UpdateStreamMetadata(ctx context.Context, streamName string, newMetadata eventstore.StreamMetadata) error
- type StreamIterator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventStore ¶
type EventStore struct {
// contains filtered or unexported fields
}
EventStore that stores stream in memory.
func (EventStore) AppendTo ¶
func (s EventStore) AppendTo(ctx context.Context, streamName string, events []*messages.Event) error
AppendTo will append events to the stream.
func (EventStore) Create ¶
func (s EventStore) Create(ctx context.Context, stream *eventstore.Stream) error
Create will create the stream with the name and metadata provided.
func (EventStore) Delete ¶
func (s EventStore) Delete(ctx context.Context, streamName string) error
Delete will remove the stream.
func (EventStore) FetchStreamMetadata ¶
func (s EventStore) FetchStreamMetadata(ctx context.Context, streamName string) (eventstore.StreamMetadata, error)
FetchStreamMetadata gets the metadata about a stream.
func (EventStore) FetchStreamNames ¶
func (s EventStore) FetchStreamNames(ctx context.Context, filter string, matcher eventstore.MetadataMatcher, limit, offset uint64) ([]string, error)
FetchStreamNames gets stream names that match the filter.
func (EventStore) FetchStreamNamesRegex ¶
func (s EventStore) FetchStreamNamesRegex(ctx context.Context, filter string, matcher eventstore.MetadataMatcher, limit, offset uint64) ([]string, error)
FetchStreamNamesRegex gets stream names that match the regex filter.
func (EventStore) Load ¶
func (s EventStore) Load(ctx context.Context, streamName string, from, count uint64, matcher eventstore.MetadataMatcher) eventstore.StreamIterator
Load events from the given stream name.
func (EventStore) LoadReverse ¶
func (s EventStore) LoadReverse(ctx context.Context, streamName string, from, count uint64, matcher eventstore.MetadataMatcher) eventstore.StreamIterator
LoadReverse Loads events from the given stream name in reverse.
func (EventStore) UpdateStreamMetadata ¶
func (s EventStore) UpdateStreamMetadata(ctx context.Context, streamName string, newMetadata eventstore.StreamMetadata) error
UpdateStreamMetadata sets the metadata for the given stream name.
type StreamIterator ¶
type StreamIterator struct {
Error error
Events []*messages.Event
// contains filtered or unexported fields
}
StreamIterator which iterates over events in memory.
func (*StreamIterator) Current ¶
func (s *StreamIterator) Current() *messages.Event
Current will return the current event in the stream.
func (*StreamIterator) Next ¶
func (s *StreamIterator) Next(context.Context) error
Next will move the cursor forward.
func (*StreamIterator) Rewind ¶
func (s *StreamIterator) Rewind()
Rewind will go back to the begining of the stream.