Documentation
¶
Index ¶
- Constants
- Variables
- func NextKey(key string) string
- func NextVersionCursor(key string) string
- func PrevKey(key string) string
- type DB
- func (db *DB) Close() error
- func (db *DB) Destroy() error
- func (db *DB) Get(key string, version int64) (*KeyValue, error)
- func (db *DB) GetMetaBlob(key string, version int64) (string, error)
- func (db *DB) Keys(start, end string, limit int) ([]*KeyValue, string, error)
- func (db *DB) Put(kv *KeyValue) error
- func (db *DB) ReverseKeys(start, end string, limit int) ([]*KeyValue, string, error)
- func (db *DB) SetMetaBlob(key string, version int64, hash string) error
- func (db *DB) Versions(key string, start, end int64, limit int) (*KeyValueVersions, int64, error)
- type KeyValue
- type KeyValueVersions
Constants ¶
View Source
const ( Sep = ':' FlagUnknown byte = iota FlagMetaBlob FlagVersion FlagKey )
View Source
const KvType = "kv"
KvType for meta serialization
Variables ¶
View Source
var ErrNotFound = errors.New("vkv: key not found")
Functions ¶
func NextVersionCursor ¶
Types ¶
type KeyValue ¶
type KeyValue struct {
SchemaVersion int `msgpack:"_v"`
Key string `msgpack:"k,omitempty"`
Version int64 `msgpack:"v"`
Hash []byte `msgpack:"h,omitempty"`
Data []byte `msgpack:"d,omitempty"`
}
func UnserializeBlob ¶
func (*KeyValue) SetHexHash ¶
type KeyValueVersions ¶
type KeyValueVersions struct {
Key string `json:"key"`
// FIXME(tsileo): turn this into a []*VkvEntry
Versions []*KeyValue `json:"versions"`
}
KeyValueVersions holds the full history for a key value pair
Click to show internal directories.
Click to hide internal directories.