cachedstore

package
v0.0.0-...-64dd8ac Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedProvider

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

CachedProvider is a spi.Provider that allows for automatic caching of data.

func NewProvider

func NewProvider(mainProvider, cacheProvider spi.Provider) *CachedProvider

NewProvider instantiates a new CachedProvider. It takes in two spi.Providers. mainProvider is the primary data source. It should be the slower storage provider. cacheProvider is the data source that will hold cached data. It should be the faster storage provider.

func (*CachedProvider) Close

func (c *CachedProvider) Close() error

Close closes all stores created under this store provider. For persistent store implementations, this does not delete any data in the underlying databases.

func (*CachedProvider) GetOpenStores

func (c *CachedProvider) GetOpenStores() []spi.Store

GetOpenStores returns all currently open stores.

func (*CachedProvider) GetStoreConfig

func (c *CachedProvider) GetStoreConfig(name string) (spi.StoreConfiguration, error)

GetStoreConfig gets the current store configuration.

func (*CachedProvider) OpenStore

func (c *CachedProvider) OpenStore(name string) (spi.Store, error)

OpenStore opens a store with the given name and returns a handle. If the store has never been opened before, then it is created. Store names are not case-sensitive.

func (*CachedProvider) SetStoreConfig

func (c *CachedProvider) SetStoreConfig(name string, config spi.StoreConfiguration) error

SetStoreConfig sets the configuration on a store.

Jump to

Keyboard shortcuts

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