cosmos-sdk: github.com/cosmos/cosmos-sdk/store/cachemulti Index | Files

package cachemulti

import "github.com/cosmos/cosmos-sdk/store/cachemulti"

Index

Package Files

store.go

type Store Uses

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

Store holds many cache-wrapped stores. Implements MultiStore. NOTE: a Store (and MultiStores in general) should never expose the keys for the substores.

func NewFromKVStore Uses

func NewFromKVStore(
    store types.KVStore, stores map[types.StoreKey]types.CacheWrapper,
    keys map[string]types.StoreKey, traceWriter io.Writer, traceContext types.TraceContext,
) Store

NewFromKVStore creates a new Store object from a mapping of store keys to CacheWrapper objects and a KVStore as the database. Each CacheWrapper store is cache-wrapped.

func NewStore Uses

func NewStore(
    db dbm.DB, stores map[types.StoreKey]types.CacheWrapper, keys map[string]types.StoreKey,
    traceWriter io.Writer, traceContext types.TraceContext,
) Store

NewStore creates a new Store object from a mapping of store keys to CacheWrapper objects. Each CacheWrapper store is cache-wrapped.

func (Store) CacheMultiStore Uses

func (cms Store) CacheMultiStore() types.CacheMultiStore

Implements MultiStore.

func (Store) CacheMultiStoreWithVersion Uses

func (cms Store) CacheMultiStoreWithVersion(_ int64) (types.CacheMultiStore, error)

CacheMultiStoreWithVersion implements the MultiStore interface. It will panic as an already cached multi-store cannot load previous versions.

TODO: The store implementation can possibly be modified to support this as it seems safe to load previous versions (heights).

func (Store) CacheWrap Uses

func (cms Store) CacheWrap() types.CacheWrap

Implements CacheWrapper.

func (Store) CacheWrapWithTrace Uses

func (cms Store) CacheWrapWithTrace(_ io.Writer, _ types.TraceContext) types.CacheWrap

CacheWrapWithTrace implements the CacheWrapper interface.

func (Store) GetKVStore Uses

func (cms Store) GetKVStore(key types.StoreKey) types.KVStore

GetKVStore returns an underlying KVStore by key.

func (Store) GetStore Uses

func (cms Store) GetStore(key types.StoreKey) types.Store

GetStore returns an underlying Store by key.

func (Store) GetStoreType Uses

func (cms Store) GetStoreType() types.StoreType

GetStoreType returns the type of the store.

func (Store) SetTracer Uses

func (cms Store) SetTracer(w io.Writer) types.MultiStore

SetTracer sets the tracer for the MultiStore that the underlying stores will utilize to trace operations. A MultiStore is returned.

func (Store) SetTracingContext Uses

func (cms Store) SetTracingContext(tc types.TraceContext) types.MultiStore

SetTracingContext updates the tracing context for the MultiStore by merging the given context with the existing context by key. Any existing keys will be overwritten. It is implied that the caller should update the context when necessary between tracing operations. It returns a modified MultiStore.

func (Store) TracingEnabled Uses

func (cms Store) TracingEnabled() bool

TracingEnabled returns if tracing is enabled for the MultiStore.

func (Store) Write Uses

func (cms Store) Write()

Write calls Write on each underlying store.

Package cachemulti imports 6 packages (graph) and is imported by 2 packages. Updated 2019-09-08. Refresh now. Tools for package owners.