Documentation ¶
Index ¶
- type CosmosIterator
- type CosmosStore
- func (s *CosmosStore) Close() error
- func (s *CosmosStore) Delete(key []byte) (err error)
- func (s *CosmosStore) Get(key []byte) (out []byte, err error)
- func (s *CosmosStore) Has(key []byte) (has bool, err error)
- func (s *CosmosStore) NewIterator() Iterator
- func (s *CosmosStore) Put(key []byte, value []byte) (err error)
- type Iterator
- type LevelDBStore
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CosmosIterator ¶
type CosmosIterator struct {
// contains filtered or unexported fields
}
CosmosIterator is a Cosmos KVStore's iterator implementation of Iterator.
func NewCosmosIterator ¶
func NewCosmosIterator(iter types.Iterator) *CosmosIterator
NewCosmosIterator returns a new Cosmos KVStore Iterator wrapper.
func (*CosmosIterator) Error ¶
func (i *CosmosIterator) Error() error
Error returns any accumulated error.
func (*CosmosIterator) Key ¶
func (i *CosmosIterator) Key() []byte
Key returns the key of the cursor.
func (*CosmosIterator) Next ¶
func (i *CosmosIterator) Next() bool
Next moves the iterator to the next sequential key in the store.
func (*CosmosIterator) Value ¶
func (i *CosmosIterator) Value() []byte
Value returns the value of the cursor.
type CosmosStore ¶
type CosmosStore struct {
// contains filtered or unexported fields
}
CosmosStore is a Cosmos KVStore implementation of Store.
func NewCosmosStore ¶
func NewCosmosStore(store types.KVStore) *CosmosStore
NewCosmosStore returns a new Cosmos KVStore wrapper.
func (*CosmosStore) Delete ¶
func (s *CosmosStore) Delete(key []byte) (err error)
Delete deletes the value for the given key. Delete will not returns error if key doesn't exist.
func (*CosmosStore) Get ¶
func (s *CosmosStore) Get(key []byte) (out []byte, err error)
Get retrives service from store. It returns an error if the store does not contains the key.
func (*CosmosStore) Has ¶
func (s *CosmosStore) Has(key []byte) (has bool, err error)
Has returns true if the key is set in the store.
func (*CosmosStore) NewIterator ¶
func (s *CosmosStore) NewIterator() Iterator
NewIterator returns a new iterator.
type Iterator ¶
type Iterator interface { // Next moves the iterator to the next sequential key in the store. Next() bool // Key returns the key of the cursor. Key() []byte // Value returns the value of the cursor. Value() []byte // Release releases the Iterator. Release() // Error returns any accumulated error. Error() error }
Iterator describes the public API of an iterator.
type LevelDBStore ¶
type LevelDBStore struct {
// contains filtered or unexported fields
}
LevelDBStore is a levelDB implementation of Store.
func NewLevelDBStore ¶
func NewLevelDBStore(path string) (*LevelDBStore, error)
NewLevelDBStore returns a new level db wrapper.
func (*LevelDBStore) Delete ¶
func (s *LevelDBStore) Delete(key []byte) error
Delete deletes the value for the given key. Delete will not returns error if key doesn't exist.
func (*LevelDBStore) Get ¶
func (s *LevelDBStore) Get(key []byte) ([]byte, error)
Get retrives service from store. It returns error if the store does not contains the key.
func (*LevelDBStore) Has ¶
func (s *LevelDBStore) Has(key []byte) (bool, error)
Has returns true if the key is set in the store.
func (*LevelDBStore) NewIterator ¶
func (s *LevelDBStore) NewIterator() Iterator
NewIterator returns a new iterator.
type Store ¶
type Store interface { // Get retrives service from store. It returns an error if the store does not contains the key. Get(key []byte) ([]byte, error) // Has returns true if the key is set in the store. Has(key []byte) (bool, error) // Delete deletes the value for the given key. Delete will not returns error if key doesn't exist. Delete(key []byte) error // Put sets the value for the given key. It overwrites any previous value. Put(key []byte, value []byte) error // NewIterator returns a new iterator. NewIterator() Iterator // Close closes the store. Close() error }
Store describes the public API of a store.