Documentation ¶
Index ¶
Constants ¶
View Source
const LocalKVStorageType = StorageType("LocalKVStorage")
View Source
const MemStorageType = StorageType("MemStorage")
Variables ¶
This section is empty.
Functions ¶
func RegisterStorage ¶
func RegisterStorage(s Storage)
Types ¶
type LocalKVStorage ¶
type LocalKVStorage struct {
// contains filtered or unexported fields
}
func NewLocalKVStorage ¶
func NewLocalKVStorage(name string) *LocalKVStorage
func (*LocalKVStorage) Exists ¶
func (lkv *LocalKVStorage) Exists(key []byte) bool
func (*LocalKVStorage) Put ¶
func (lkv *LocalKVStorage) Put(key, val []byte) error
func (*LocalKVStorage) Type ¶
func (lkv *LocalKVStorage) Type() StorageType
type MemStorage ¶
type MemStorage struct {
// contains filtered or unexported fields
}
func NewMemStorage ¶
func NewMemStorage() *MemStorage
func (*MemStorage) Exists ¶
func (mem *MemStorage) Exists(key []byte) bool
func (*MemStorage) Type ¶
func (mem *MemStorage) Type() StorageType
type Storage ¶
type Storage interface { Get([]byte) ([]byte, error) Exists([]byte) bool Put([]byte, []byte) error Type() StorageType }
func GetStorage ¶
func GetStorage(name StorageType) Storage
type StorageType ¶
type StorageType string
Click to show internal directories.
Click to hide internal directories.