store

package
v0.21.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HasCost          = 10
	ReadCostFlat     = 10
	ReadCostPerByte  = 1
	WriteCostFlat    = 10
	WriteCostPerByte = 10
	KeyCostFlat      = 5
	ValueCostFlat    = 10
	ValueCostPerByte = 1
)

nolint

Variables

This section is empty.

Functions

func First

func First(st KVStore, start, end []byte) (kv cmn.KVPair, ok bool)

Gets the first item.

func Last

func Last(st KVStore, start, end []byte) (kv cmn.KVPair, ok bool)

Gets the last item. `end` is exclusive.

func NewCacheKVStore

func NewCacheKVStore(parent KVStore) *cacheKVStore

nolint

func NewCommitMultiStore

func NewCommitMultiStore(db dbm.DB) *rootMultiStore

nolint

func NewGasKVStore added in v0.18.0

func NewGasKVStore(gasMeter sdk.GasMeter, parent sdk.KVStore) *gasKVStore

nolint

Types

type CacheKVStore

type CacheKVStore = types.CacheKVStore

Import cosmos-sdk/types/store.go for convenience. nolint

type CacheMultiStore

type CacheMultiStore = types.CacheMultiStore

Import cosmos-sdk/types/store.go for convenience. nolint

type CacheWrap

type CacheWrap = types.CacheWrap

Import cosmos-sdk/types/store.go for convenience. nolint

type CacheWrapper

type CacheWrapper = types.CacheWrapper

Import cosmos-sdk/types/store.go for convenience. nolint

type CommitID

type CommitID = types.CommitID

Import cosmos-sdk/types/store.go for convenience. nolint

type CommitKVStore

type CommitKVStore = types.CommitKVStore

Import cosmos-sdk/types/store.go for convenience. nolint

type CommitMultiStore

type CommitMultiStore = types.CommitMultiStore

Import cosmos-sdk/types/store.go for convenience. nolint

type CommitStore

type CommitStore = types.CommitStore

Import cosmos-sdk/types/store.go for convenience. nolint

func LoadIAVLStore

func LoadIAVLStore(db dbm.DB, id CommitID, pruning sdk.PruningStrategy) (CommitStore, error)

load the iavl store

type Committer

type Committer = types.Committer

Import cosmos-sdk/types/store.go for convenience. nolint

type Iterator

type Iterator = types.Iterator

Import cosmos-sdk/types/store.go for convenience. nolint

type KVPair added in v0.17.0

type KVPair = types.KVPair

Import cosmos-sdk/types/store.go for convenience. nolint

type KVStore

type KVStore = types.KVStore

Import cosmos-sdk/types/store.go for convenience. nolint

type MultiStore

type MultiStore = types.MultiStore

Import cosmos-sdk/types/store.go for convenience. nolint

type Queryable

type Queryable = types.Queryable

Import cosmos-sdk/types/store.go for convenience. nolint

type Store

type Store = types.Store

Import cosmos-sdk/types/store.go for convenience. nolint

type StoreKey

type StoreKey = types.StoreKey

Import cosmos-sdk/types/store.go for convenience. nolint

type StoreType

type StoreType = types.StoreType

Import cosmos-sdk/types/store.go for convenience. nolint

type TraceContext added in v0.21.0

type TraceContext = types.TraceContext

Import cosmos-sdk/types/store.go for convenience. nolint

type TraceKVStore added in v0.21.0

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

TraceKVStore implements the KVStore interface with tracing enabled. Operations are traced on each core KVStore call and written to the underlying io.writer.

TODO: Should we use a buffered writer and implement Commit on TraceKVStore?

func NewTraceKVStore added in v0.21.0

func NewTraceKVStore(parent sdk.KVStore, writer io.Writer, tc TraceContext) *TraceKVStore

NewTraceKVStore returns a reference to a new traceKVStore given a parent KVStore implementation and a buffered writer.

func (*TraceKVStore) CacheWrap added in v0.21.0

func (tkv *TraceKVStore) CacheWrap() sdk.CacheWrap

CacheWrap implements the KVStore interface. It panics as a TraceKVStore cannot be cache wrapped.

func (*TraceKVStore) CacheWrapWithTrace added in v0.21.0

func (tkv *TraceKVStore) CacheWrapWithTrace(_ io.Writer, _ TraceContext) CacheWrap

CacheWrapWithTrace implements the KVStore interface. It panics as a TraceKVStore cannot be cache wrapped.

func (*TraceKVStore) Delete added in v0.21.0

func (tkv *TraceKVStore) Delete(key []byte)

Delete implements the KVStore interface. It traces a write operation and delegates the Delete call to the parent KVStore.

func (*TraceKVStore) Get added in v0.21.0

func (tkv *TraceKVStore) Get(key []byte) []byte

Get implements the KVStore interface. It traces a read operation and delegates a Get call to the parent KVStore.

func (*TraceKVStore) GetStoreType added in v0.21.0

func (tkv *TraceKVStore) GetStoreType() sdk.StoreType

GetStoreType implements the KVStore interface. It returns the underlying KVStore type.

func (*TraceKVStore) Has added in v0.21.0

func (tkv *TraceKVStore) Has(key []byte) bool

Has implements the KVStore interface. It delegates the Has call to the parent KVStore.

func (*TraceKVStore) Iterator added in v0.21.0

func (tkv *TraceKVStore) Iterator(start, end []byte) sdk.Iterator

Iterator implements the KVStore interface. It delegates the Iterator call the to the parent KVStore.

func (*TraceKVStore) Prefix added in v0.21.0

func (tkv *TraceKVStore) Prefix(prefix []byte) KVStore

Prefix implements the KVStore interface.

func (*TraceKVStore) ReverseIterator added in v0.21.0

func (tkv *TraceKVStore) ReverseIterator(start, end []byte) sdk.Iterator

ReverseIterator implements the KVStore interface. It delegates the ReverseIterator call the to the parent KVStore.

func (*TraceKVStore) Set added in v0.21.0

func (tkv *TraceKVStore) Set(key []byte, value []byte)

Set implements the KVStore interface. It traces a write operation and delegates the Set call to the parent KVStore.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL