store

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queryable

type Queryable interface {
	Query(abci.RequestQuery) abci.ResponseQuery
}

Queryable allows a Store to expose internal state to the abci.Query interface. Multistore can route requests to the proper Store.

This is an optional, but useful extension to any CommitStore

type Store

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

func NewStore

func NewStore(db dbm.DB) *Store

func (*Store) CacheMultiStore

func (rs *Store) CacheMultiStore() types.CacheMultiStore

CacheMultiStore cache-wraps the multi-store and returns a CacheMultiStore. It implements the MultiStore interface.

func (*Store) CacheWrap

func (rs *Store) CacheWrap() types.CacheWrap

CacheWrap implements CacheWrapper/Store/CommitStore.

func (*Store) GetCommitKVStore

func (rs *Store) GetCommitKVStore(key types.StoreKey) types.CommitKVStore

GetCommitKVStore returns a mounted CommitKVStore for a given StoreKey. If the store is wrapped in an inter-block cache, it will be unwrapped before returning.

func (*Store) GetCommitStore

func (rs *Store) GetCommitStore(key types.StoreKey) types.CommitStore

GetCommitStore returns a mounted CommitStore for a given StoreKey. If the store is wrapped in an inter-block cache, it will be unwrapped before returning.

func (*Store) GetKVStore

func (rs *Store) GetKVStore(key types.StoreKey) types.KVStore

GetKVStore returns a mounted KVStore for a given StoreKey. If tracing is enabled on the KVStore, a wrapped TraceKVStore will be returned with the root store's tracer, otherwise, the original KVStore will be returned.

NOTE: The returned KVStore may be wrapped in an inter-block cache if it is set on the root store.

func (*Store) GetStore

func (rs *Store) GetStore(key types.StoreKey) types.Store

GetStore returns a mounted Store for a given StoreKey. If the StoreKey does not exist, it will panic. If the Store is wrapped in an inter-block cache, it will be unwrapped prior to being returned.

TODO: This isn't used directly upstream. Consider returning the Store as-is instead of unwrapping.

func (*Store) GetStoreType

func (rs *Store) GetStoreType() types.StoreType

GetStoreType implements Store.

func (*Store) LoadStores

func (rs *Store) LoadStores() error

func (*Store) MountStoreWithDB

func (rs *Store) MountStoreWithDB(key types.StoreKey, typ types.StoreType, db dbm.DB)

MountStoreWithDB implements CommitMultiStore.

func (*Store) Query

func (rs *Store) Query(req abci.RequestQuery) abci.ResponseQuery

Query calls substore.Query with the same `req` where `req.Path` is modified to remove the substore prefix. Ie. `req.Path` here is `/<substore>/<path>`, and trimmed to `/<path>` for the substore. TODO: add proof for `multistore -> substore`.

func (*Store) SetTracer

func (rs *Store) SetTracer(w io.Writer) *Store

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

func (*Store) SetTracingContext

func (rs *Store) SetTracingContext(tc types.TraceContext) *Store

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

func (rs *Store) TracingEnabled() bool

TracingEnabled returns if tracing is enabled for the MultiStore.

Jump to

Keyboard shortcuts

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