mirror of
https://github.com/safing/portbase
synced 2025-09-15 01:29:51 +00:00
Finish badger and sinkhole storage
This commit is contained in:
parent
2716b9663c
commit
94598b115b
6 changed files with 266 additions and 28 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue