Documentation
¶
Index ¶
- func New(ctx context.Context, wg *sync.WaitGroup, cfg *drivers.Config) (bool, server.Backend, error)
- type Memory
- func (m *Memory) Compact(ctx context.Context, revision int64) (int64, error)
- func (m *Memory) Count(ctx context.Context, key, end string, revision int64) (int64, int64, error)
- func (m *Memory) Create(ctx context.Context, key string, value []byte, lease int64) (int64, error)
- func (m *Memory) CurrentRevision(ctx context.Context) (int64, error)
- func (m *Memory) DbSize(ctx context.Context) (int64, error)
- func (m *Memory) Delete(ctx context.Context, key string, revision int64) (int64, *server.KeyValue, bool, error)
- func (m *Memory) Get(ctx context.Context, key string, revision int64, keysOnly bool) (int64, *server.KeyValue, error)
- func (m *Memory) List(ctx context.Context, key, end string, limit, revision int64, keysOnly bool) (int64, []*server.KeyValue, error)
- func (m *Memory) Start(ctx context.Context) error
- func (m *Memory) Update(ctx context.Context, key string, value []byte, revision, lease int64) (int64, *server.KeyValue, bool, error)
- func (m *Memory) WaitForSyncTo(revision int64)
- func (m *Memory) Watch(ctx context.Context, key, end string, startRevision int64) server.WatchResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
func (*Memory) Compact ¶
Compact discards events below the given revision. The log slice is trimmed to entries with revision > the compact target — events at or below the boundary are no longer accessible to watchers. Per-key history in m.keys is trimmed to its floor (the latest entry with revision <= the target) so that reads at the compact boundary still resolve to the correct value; if that floor is a tombstone the entire key history is removed. Entries with revision > the compact target are always retained.
func (*Memory) CurrentRevision ¶
func (*Memory) Get ¶
func (m *Memory) Get(ctx context.Context, key string, revision int64, keysOnly bool) (int64, *server.KeyValue, error)
Get returns the current revision and the KeyValue for the given key.
func (*Memory) WaitForSyncTo ¶
Click to show internal directories.
Click to hide internal directories.