Documentation
¶
Index ¶
- Variables
- type MemoryStorage
- func (m *MemoryStorage) Close() error
- func (m *MemoryStorage) Delete(ctx context.Context, key string) error
- func (m *MemoryStorage) Exists(ctx context.Context, key string) (bool, error)
- func (m *MemoryStorage) Get(ctx context.Context, key string) ([]byte, error)
- func (m *MemoryStorage) Put(ctx context.Context, key string, value []byte) error
- type Storage
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrKeyNotFound = errors.New("key not found") ErrStorageClosed = errors.New("storage is closed") ErrInvalidKey = errors.New("invalid key") ErrInvalidValue = errors.New("invalid value") )
Common storage errors
Functions ¶
This section is empty.
Types ¶
type MemoryStorage ¶
type MemoryStorage struct {
// contains filtered or unexported fields
}
MemoryStorage is a simple in-memory storage implementation for testing.
func NewMemoryStorage ¶
func NewMemoryStorage() *MemoryStorage
NewMemoryStorage creates a new in-memory storage backend.
func (*MemoryStorage) Close ¶
func (m *MemoryStorage) Close() error
func (*MemoryStorage) Delete ¶
func (m *MemoryStorage) Delete(ctx context.Context, key string) error
type Storage ¶
type Storage interface {
// Get retrieves data for the given key.
Get(ctx context.Context, key string) ([]byte, error)
// Put stores data for the given key.
Put(ctx context.Context, key string, value []byte) error
// Delete removes the data for the given key.
Delete(ctx context.Context, key string) error
// Exists checks if a key exists in storage.
Exists(ctx context.Context, key string) (bool, error)
// Close closes the storage backend.
Close() error
}
Storage defines the interface for storage backends.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package memstore provides an in-memory implementation of the go-sync-kit EventStore.
|
Package memstore provides an in-memory implementation of the go-sync-kit EventStore. |
|
Package postgres provides a PostgreSQL implementation of the go-sync-kit EventStore with real-time LISTEN/NOTIFY capabilities for event streaming.
|
Package postgres provides a PostgreSQL implementation of the go-sync-kit EventStore with real-time LISTEN/NOTIFY capabilities for event streaming. |
|
example
command
|
|
|
Package sqlite provides a SQLite implementation of the go-sync-kit EventStore.
|
Package sqlite provides a SQLite implementation of the go-sync-kit EventStore. |
Click to show internal directories.
Click to hide internal directories.