blasphem/pkg/storage/fs.go
2022-11-13 10:03:13 -05:00

28 lines
502 B
Go

package storage
import (
"errors"
"sync"
)
var (
ErrNoSuchKey = errors.New("no such key in store")
)
type Item interface {
sync.Locker
Dirty()
IsDirty() bool
GetData() interface{}
SetData(interface{})
ItemKey() string
}
type Store interface {
GetItem(key string, data interface{}) (Item, error)
Get(key string, data interface{}) error
Put(key string, version, minorVersion int, secretMode bool, data interface{}) (Item, error)
FlushAll() []error
Flush(key string) error
Shutdown()
}