batchedstore

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: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

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

Provider is a spi.Provider that allows for data to be automatically batched. It acts as a wrapper around another storage provider (typically, one that would benefit from batching). TODO (#2484): Support batching across multiple stores for storage providers that inherently support this

(like the EDV REST provider, which uses a single underlying database (vault) for all of its stores).

func NewProvider

func NewProvider(underlyingProvider spi.Provider, batchSizeLimit int) *Provider

NewProvider instantiates a new batched Provider.

func (*Provider) Close

func (p *Provider) 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 (*Provider) GetOpenStores

func (p *Provider) GetOpenStores() []spi.Store

GetOpenStores returns all currently open stores.

func (*Provider) GetStoreConfig

func (p *Provider) GetStoreConfig(name string) (spi.StoreConfiguration, error)

GetStoreConfig gets the current store configuration. The store must be created prior to calling this method. If the store cannot be found, then an error wrapping ErrStoreNotFound will be returned by the underlying provider. If name is blank, then an error will be returned by the underlying provider.

func (*Provider) OpenStore

func (p *Provider) 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. If name is blank, then an error will be returned by the underlying provider.

func (*Provider) SetStoreConfig

func (p *Provider) SetStoreConfig(name string, config spi.StoreConfiguration) error

SetStoreConfig sets the configuration on a store. The store must be created prior to calling this method. If the store cannot be found, then an error wrapping ErrStoreNotFound will be returned by the underlying provider. If name is blank, then an error will be returned by the underlying provider.

Jump to

Keyboard shortcuts

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