Versions in this module Expand all Collapse all v0 v0.0.8 Jun 3, 2020 v0.0.7 Mar 18, 2020 Changes in this version + var ErrNotFound = errors.New("key not found") + func IPFSexport() error + func LoadJSON(storage Storage, key []byte, v interface{}) error + func StoreJSON(tx Tx, key []byte, v interface{}) error + type KV struct + K []byte + V []byte + type LevelDbStorage struct + func NewLevelDbStorage(path string, errorIfMissing bool) (*LevelDbStorage, error) + func (l *LevelDbStorage) Close() + func (l *LevelDbStorage) Get(key []byte) ([]byte, error) + func (l *LevelDbStorage) Info() string + func (l *LevelDbStorage) Iterate(f func([]byte, []byte) (bool, error)) error + func (l *LevelDbStorage) LevelDB() *leveldb.DB + func (l *LevelDbStorage) List(limit int) ([]KV, error) + func (l *LevelDbStorage) NewTx() (Tx, error) + func (l *LevelDbStorage) RawDump() error + func (l *LevelDbStorage) WithPrefix(prefix []byte) Storage + type LevelDbStorageTx struct + func (l *LevelDbStorageTx) Close() + func (l *LevelDbStorageTx) Commit() error + func (l *LevelDbStorageTx) Get(key []byte) ([]byte, error) + func (tx *LevelDbStorageTx) Add(atx Tx) + func (tx *LevelDbStorageTx) Put(k, v []byte) + type MemoryStorage struct + func NewMemoryStorage() *MemoryStorage + func (l *MemoryStorage) Get(key []byte) ([]byte, error) + func (l *MemoryStorage) Info() string + func (l *MemoryStorage) Iterate(f func([]byte, []byte) (bool, error)) error + func (l *MemoryStorage) List(limit int) ([]KV, error) + func (m *MemoryStorage) Close() + func (m *MemoryStorage) NewTx() (Tx, error) + func (m *MemoryStorage) WithPrefix(prefix []byte) Storage + type MemoryStorageTx struct + func (tx *MemoryStorageTx) Add(atx Tx) + func (tx *MemoryStorageTx) Close() + func (tx *MemoryStorageTx) Commit() error + func (tx *MemoryStorageTx) Get(key []byte) ([]byte, error) + func (tx *MemoryStorageTx) Put(k, v []byte) + type Storage interface + Close func() + Get func([]byte) ([]byte, error) + Info func() string + Iterate func(func([]byte, []byte) (bool, error)) error + List func(int) ([]KV, error) + NewTx func() (Tx, error) + WithPrefix func(prefix []byte) Storage + type StorageList struct + func NewStorageList(dbPrefix []byte) *StorageList + func (sl *StorageList) Append(tx Tx, key []byte, value interface{}) error + func (sl *StorageList) Get(tx Tx, key []byte, value interface{}) error + func (sl *StorageList) GetByIdx(tx Tx, idx uint32, value interface{}) ([]byte, error) + func (sl *StorageList) Init(tx Tx) + func (sl *StorageList) Length(tx Tx) (uint32, error) + type StorageValue struct + func NewStorageValue(dbKey []byte) *StorageValue + func (sv *StorageValue) Get(tx Tx) (uint32, error) + func (sv *StorageValue) Set(tx Tx, v uint32) + type Tx interface + Add func(Tx) + Close func() + Commit func() error + Get func([]byte) ([]byte, error) + Put func(k, v []byte)