Finish badger and sinkhole storage

This commit is contained in:
Daniel 2018-09-05 17:05:23 +02:00
parent 2716b9663c
commit 94598b115b
6 changed files with 266 additions and 28 deletions

View file

@ -8,27 +8,13 @@ import (
// Interface defines the database storage API.
type Interface interface {
// Retrieve
Exists(key string) (bool, error)
Get(key string) (model.Model, error)
// Modify
Create(model model.Model) error
Update(model model.Model) error // create when not exists
UpdateOrCreate(model model.Model) error // update, create if not exists.
Put(m model.Model) error
Delete(key string) error
Query(q *query.Query) (*iterator.Iterator, error)
// Partial
// What happens if I mutate a value that does not yet exist? How would I know its type?
InsertPartial(key string, partialObject interface{})
InsertValue(key string, attribute string, value interface{})
// Query
Query(q *query.Query, local, internal bool) (*iterator.Iterator, error)
// Meta
SetAbsoluteExpiry(key string, time int64)
SetRelativateExpiry(key string, duration int64)
MakeCrownJewel(key string)
MakeSecret(key string)
Maintain() error
MaintainThorough() error
Shutdown() error
}