Documentation
¶
Overview ¶
Package storage provides event storage implementations.
Index ¶
- type MemoryStorage
- func (s *MemoryStorage) Cleanup(maxAge time.Duration)
- func (s *MemoryStorage) Count(ctx context.Context, query core.Query) (int, error)
- func (s *MemoryStorage) Query(ctx context.Context, query core.Query) ([]core.Event, error)
- func (s *MemoryStorage) Store(ctx context.Context, event core.Event) error
- type StorageWithSink
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryStorage ¶
type MemoryStorage struct {
// contains filtered or unexported fields
}
MemoryStorage implements EventSink using in-memory storage. This is suitable for development and small-scale deployments.
func NewMemoryStorage ¶
func NewMemoryStorage() *MemoryStorage
NewMemoryStorage creates a new in-memory event storage.
func (*MemoryStorage) Cleanup ¶
func (s *MemoryStorage) Cleanup(maxAge time.Duration)
Cleanup removes old events (for memory management).
type StorageWithSink ¶
type StorageWithSink struct {
// contains filtered or unexported fields
}
StorageWithSink wraps a storage implementation and automatically stores events from a stream.
func NewStorageWithSink ¶
func NewStorageWithSink(storage core.EventSink, stream core.EventStream) *StorageWithSink
NewStorageWithSink creates storage that automatically consumes from an event stream.
func (*StorageWithSink) Close ¶
func (s *StorageWithSink) Close() error
Close stops consuming events.
Click to show internal directories.
Click to hide internal directories.