Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Uniq

func Uniq(source storage.KVIterator) *uniqueIterator

Types

type CacheDB

type CacheDB struct {
	// contains filtered or unexported fields
}

func NewCacheDB

func NewCacheDB(backend storage.KVIterableReader) *CacheDB

func (*CacheDB) Close

func (cdb *CacheDB) Close() error

func (*CacheDB) Commit

func (cdb *CacheDB) Commit(writer storage.KVWriter)

func (*CacheDB) Delete

func (cdb *CacheDB) Delete(key []byte) error

func (*CacheDB) DeleteSync

func (cdb *CacheDB) DeleteSync(key []byte) error

func (*CacheDB) Get

func (cdb *CacheDB) Get(key []byte) ([]byte, error)

    DB implementation

    func (*CacheDB) Has

    func (cdb *CacheDB) Has(key []byte) (bool, error)

    func (*CacheDB) Iterator

    func (cdb *CacheDB) Iterator(low, high []byte) (storage.KVIterator, error)

    func (*CacheDB) NewBatch

    func (cdb *CacheDB) NewBatch() dbm.Batch

    func (*CacheDB) Print

    func (cdb *CacheDB) Print() error

    func (*CacheDB) ReverseIterator

    func (cdb *CacheDB) ReverseIterator(low, high []byte) (storage.KVIterator, error)

    func (*CacheDB) Set

    func (cdb *CacheDB) Set(key, value []byte) error

    func (*CacheDB) SetSync

    func (cdb *CacheDB) SetSync(key, value []byte) error

    func (*CacheDB) Stats

    func (cdb *CacheDB) Stats() map[string]string

    type ChannelIterator

    type ChannelIterator struct {
    	// contains filtered or unexported fields
    }

    func NewChannelIterator

    func NewChannelIterator(ch <-chan KVPair, start, end []byte) *ChannelIterator

      ChannelIterator wraps a stream of kvp KVPairs over a channel as a stateful KVIterator. The start and end keys provided are purely indicative (for Domain()) and are assumed to be honoured by the input channel - they are not checked and keys are not sorted. NewChannelIterator will block until the first value is received over the channel.

      func (*ChannelIterator) Close

      func (it *ChannelIterator) Close()

      func (*ChannelIterator) Domain

      func (it *ChannelIterator) Domain() ([]byte, []byte)

      func (*ChannelIterator) Error

      func (it *ChannelIterator) Error() error

      func (*ChannelIterator) Key

      func (it *ChannelIterator) Key() []byte

      func (*ChannelIterator) Next

      func (it *ChannelIterator) Next()

      func (*ChannelIterator) Valid

      func (it *ChannelIterator) Valid() bool

      func (*ChannelIterator) Value

      func (it *ChannelIterator) Value() []byte

      type KVCache

      type KVCache struct {
      	sync.RWMutex
      	// contains filtered or unexported fields
      }

      func NewKVCache

      func NewKVCache() *KVCache

        Creates an in-memory cache wrapping a map that stores the provided tombstone value for deleted keys

        func (*KVCache) Delete

        func (kvc *KVCache) Delete(key []byte)

        func (*KVCache) Get

        func (kvc *KVCache) Get(key []byte) []byte

        func (*KVCache) Has

        func (kvc *KVCache) Has(key []byte) bool

        func (*KVCache) Info

        func (kvc *KVCache) Info(key []byte) (value []byte, deleted bool)

        func (*KVCache) Iterator

        func (kvc *KVCache) Iterator(low, high []byte) storage.KVIterator

        func (*KVCache) Reset

        func (kvc *KVCache) Reset()

        func (*KVCache) ReverseIterator

        func (kvc *KVCache) ReverseIterator(low, high []byte) storage.KVIterator

        func (*KVCache) Set

        func (kvc *KVCache) Set(key, value []byte)

        func (*KVCache) WriteTo

        func (kvc *KVCache) WriteTo(writer storage.KVWriter)

          Writes contents of cache to backend without flushing the cache

          type KVCacheIterator

          type KVCacheIterator struct {
          	// contains filtered or unexported fields
          }

          func (*KVCacheIterator) Close

          func (kvi *KVCacheIterator) Close()

          func (*KVCacheIterator) Domain

          func (kvi *KVCacheIterator) Domain() ([]byte, []byte)

          func (*KVCacheIterator) Error

          func (kvi *KVCacheIterator) Error() error

          func (*KVCacheIterator) Info

          func (kvi *KVCacheIterator) Info() (key, value []byte, deleted bool)

          func (*KVCacheIterator) Key

          func (kvi *KVCacheIterator) Key() []byte

          func (*KVCacheIterator) Next

          func (kvi *KVCacheIterator) Next()

          func (*KVCacheIterator) Valid

          func (kvi *KVCacheIterator) Valid() bool

          func (*KVCacheIterator) Value

          func (kvi *KVCacheIterator) Value() []byte

          type KVPair

          type KVPair struct {
          	Key   []byte
          	Value []byte
          }

          func (KVPair) String

          func (kv KVPair) String() string

          type KVPairs

          type KVPairs []KVPair

          func (KVPairs) Len

          func (kvp KVPairs) Len() int

          func (KVPairs) Less

          func (kvp KVPairs) Less(i, j int) bool

          func (KVPairs) Sorted

          func (kvp KVPairs) Sorted() KVPairs

          func (KVPairs) Swap

          func (kvp KVPairs) Swap(i, j int)

          type MultiIterator

          type MultiIterator struct {
          	// contains filtered or unexported fields
          }

          func NewMultiIterator

          func NewMultiIterator(reverse bool, iterators ...storage.KVIterator) *MultiIterator

            MultiIterator iterates in order over a series o

            func (*MultiIterator) Close

            func (mi *MultiIterator) Close()

            func (*MultiIterator) Domain

            func (mi *MultiIterator) Domain() ([]byte, []byte)

            func (*MultiIterator) Error

            func (mi *MultiIterator) Error() error

            func (*MultiIterator) Key

            func (mi *MultiIterator) Key() []byte

            func (*MultiIterator) Len

            func (mi *MultiIterator) Len() int

              sort.Interface implementation

              func (*MultiIterator) Less

              func (mi *MultiIterator) Less(i, j int) bool

              func (*MultiIterator) Next

              func (mi *MultiIterator) Next()

              func (*MultiIterator) Peek

              func (mi *MultiIterator) Peek() storage.KVIterator

              func (*MultiIterator) Pop

              func (mi *MultiIterator) Pop() interface{}

              func (*MultiIterator) Push

              func (mi *MultiIterator) Push(x interface{})

              func (*MultiIterator) Swap

              func (mi *MultiIterator) Swap(i, j int)

              func (*MultiIterator) Valid

              func (mi *MultiIterator) Valid() bool

              func (*MultiIterator) Value

              func (mi *MultiIterator) Value() []byte