Documentation ¶
Index ¶
- Variables
- type DebugStore
- func (m *DebugStore) Close() error
- func (m *DebugStore) Connect() error
- func (m *DebugStore) Delete(key string) error
- func (m *DebugStore) Get(key string) ([]byte, error)
- func (m *DebugStore) GetPrefix(prefix string, offset, limit int) ([]*KeyValue, error)
- func (m *DebugStore) IterateTxnPrefix(prefix string, fn func(StorageTxn, string) error) error
- func (m *DebugStore) IterateValuesPrefix(prefix string, fn func(string, []byte) error) error
- func (m *DebugStore) Set(key string, value []byte) error
- type DebugStoreConfig
- type FileStore
- func (s *FileStore) Close() error
- func (s *FileStore) Connect() error
- func (s *FileStore) Delete(key string) error
- func (s *FileStore) Get(key string) ([]byte, error)
- func (s *FileStore) GetPrefix(prefix string, offset, limit int) ([]*KeyValue, error)
- func (s *FileStore) IterateTxnPrefix(prefix string, fn func(StorageTxn, string) error) error
- func (s *FileStore) IterateValuesPrefix(prefix string, fn func(string, []byte) error) error
- func (s *FileStore) Set(key string, value []byte) error
- func (s *FileStore) Txn(readOnly bool, fn func(StorageTxn) error) error
- type FileStoreConfig
- type FileStoreTxn
- func (tx *FileStoreTxn) Delete(key string) error
- func (tx *FileStoreTxn) Get(key string) ([]byte, error)
- func (s *FileStoreTxn) GetPrefix(prefix string, offset, limit int) ([]*KeyValue, error)
- func (tx *FileStoreTxn) IterateTxnPrefix(prefix string, fn func(StorageTxn, string) error) error
- func (tx *FileStoreTxn) IterateValuesPrefix(prefix string, fn func(string, []byte) error) error
- func (tx *FileStoreTxn) Set(key string, value []byte) error
- type KeyValue
- type MemoryStore
- type MemoryStoreConfig
- type Storage
- type StorageTxn
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrStoreLocked is returned when the storage is locked. ErrStoreLocked error = errors.New("storage is locked") // ErrKeyNotFound is returned when the key is not found. ErrKeyNotFound error = errors.New("key not found") // ErrTxnReadOnly is returned when the transaction is read only. ErrTxnReadOnly error = errors.New("transaction is read only") )
Functions ¶
This section is empty.
Types ¶
type DebugStore ¶ added in v0.8.0
type DebugStore struct {
// contains filtered or unexported fields
}
func NewDebugStore ¶ added in v0.8.0
func NewDebugStore(cfg *DebugStoreConfig) *DebugStore
func (*DebugStore) Close ¶ added in v0.8.0
func (m *DebugStore) Close() error
func (*DebugStore) Connect ¶ added in v0.8.0
func (m *DebugStore) Connect() error
func (*DebugStore) Delete ¶ added in v0.8.0
func (m *DebugStore) Delete(key string) error
func (*DebugStore) GetPrefix ¶ added in v0.8.0
func (m *DebugStore) GetPrefix(prefix string, offset, limit int) ([]*KeyValue, error)
func (*DebugStore) IterateTxnPrefix ¶ added in v0.8.0
func (m *DebugStore) IterateTxnPrefix(prefix string, fn func(StorageTxn, string) error) error
func (*DebugStore) IterateValuesPrefix ¶ added in v0.8.0
type DebugStoreConfig ¶ added in v0.8.0
type FileStore ¶
type FileStore struct {
// contains filtered or unexported fields
}
func NewFileStore ¶
func NewFileStore(fsConfig *FileStoreConfig) *FileStore
func (*FileStore) IterateTxnPrefix ¶
func (*FileStore) IterateValuesPrefix ¶
type FileStoreConfig ¶
type FileStoreTxn ¶
type FileStoreTxn struct {
// contains filtered or unexported fields
}
func (*FileStoreTxn) Delete ¶
func (tx *FileStoreTxn) Delete(key string) error
func (*FileStoreTxn) GetPrefix ¶
func (s *FileStoreTxn) GetPrefix(prefix string, offset, limit int) ([]*KeyValue, error)
func (*FileStoreTxn) IterateTxnPrefix ¶
func (tx *FileStoreTxn) IterateTxnPrefix(prefix string, fn func(StorageTxn, string) error) error
func (*FileStoreTxn) IterateValuesPrefix ¶
type MemoryStore ¶
type MemoryStore struct {
*FileStore
}
func NewMemoryStore ¶
func NewMemoryStore(cfg *MemoryStoreConfig) *MemoryStore
type MemoryStoreConfig ¶
type Storage ¶
type Storage interface { StorageTxn Connect() error Close() error }
type StorageTxn ¶
type StorageTxn interface { Get(string) ([]byte, error) Set(string, []byte) error IterateValuesPrefix(prefix string, fn func(key string, val []byte) error) error IterateTxnPrefix(prefix string, fn func(txn StorageTxn, key string) error) error GetPrefix(prefix string, offset, limit int) ([]*KeyValue, error) Delete(string) error }
Click to show internal directories.
Click to hide internal directories.