Documentation ¶
Index ¶
- type CachedProvider
- func (c *CachedProvider) Close() error
- func (c *CachedProvider) GetOpenStores() []spi.Store
- func (c *CachedProvider) GetStoreConfig(name string) (spi.StoreConfiguration, error)
- func (c *CachedProvider) OpenStore(name string) (spi.Store, error)
- func (c *CachedProvider) SetStoreConfig(name string, config spi.StoreConfiguration) error
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.