Documentation ¶
Index ¶
- type KV
- func (s *KV) AllCommitted() ([]*store.Item, error)
- func (s *KV) AllDirty() ([]*store.Item, error)
- func (s *KV) AllNewerCommitted(keyVersions map[string]uint64) ([]*store.Item, error)
- func (s *KV) AllNewerDirty(keyVersions map[string]uint64) ([]*store.Item, error)
- func (s *KV) Commit(key string, version uint64) error
- func (s *KV) Read(key string) (*store.Item, error)
- func (s *KV) ReadVersion(key string, version uint64) (*store.Item, error)
- func (s *KV) Write(key string, val []byte, version uint64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KV ¶
type KV struct {
// contains filtered or unexported fields
}
KV is an in-memory key/value storage.
func (*KV) AllCommitted ¶
AllCommitted returns all committed items.
func (*KV) AllNewerCommitted ¶
AllNewerCommitted returns all committed items who's key is not in keyVersions or who's version is higher than the versions in keyVersions.
func (*KV) AllNewerDirty ¶
AllNewerDirty returns all uncommitted items who's key is not in keyVersions or who's version is higher than the versions in keyVersions.
func (*KV) Read ¶
Read an item from the store by key. If there is an uncommitted (dirty) version of the item in the store, it returns a ErrDirtystore.Item error. If no item exists for that key it returns a ErrNotFound error.
func (*KV) ReadVersion ¶
ReadVersion finds an item for the given key with the matching version. If no item is found for that version of key, ErrNotFound is returned