cachemulti

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: Apache-2.0, UNKNOWN not legal advice Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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 New

func New(
	stores map[types.StoreKey]types.Store,
	keys map[string]types.StoreKey,
) Store

func NewFromStores

func NewFromStores(
	stores map[types.StoreKey]types.Store,
	keys map[string]types.StoreKey,
) Store

func (Store) Checkpoint

func (cms Store) Checkpoint()

Checkpoint snapshots each sub-store's cache state.

Every substore arrives via store.CacheWrap() in NewFromStores, which always returns a *cache.cacheStore (every CacheWrap implementation in-tree delegates to cache.New). *cacheStore declares types.Checkpointable via a compile-time assertion, so the type assertions below are safe today; if a future store's CacheWrap returns something else, the panic is traceable to the missing interface rather than a bare anonymous-interface mismatch.

func (Store) GetStore

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

GetStore returns an underlying Store by key.

func (Store) HasCheckpoint

func (cms Store) HasCheckpoint() bool

HasCheckpoint returns true if any sub-store has an active checkpoint.

func (Store) MultiCacheWrap

func (cms Store) MultiCacheWrap() types.MultiStore

Implements MultiStore.

func (Store) MultiWrite

func (cms Store) MultiWrite()

MultiWrite calls Write on each underlying store.

func (Store) WriteCheckpoint

func (cms Store) WriteCheckpoint()

WriteCheckpoint restores each sub-store to its checkpoint state and flushes only the checkpointed entries to the parent.

Jump to

Keyboard shortcuts

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