mem

package module
v0.0.0-...-22156a9 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 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 represents an in-memory implementation of the newstorage.Provider interface.

func NewProvider

func NewProvider() *Provider

NewProvider instantiates a new in-memory storage Provider.

func (*Provider) Close

func (p *Provider) Close() error

Close closes all stores created under this store provider.

func (*Provider) GetOpenStores

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

GetOpenStores returns all currently open stores.

func (*Provider) GetStoreConfig

func (p *Provider) GetStoreConfig(name string) (newstorage.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 newstorage.ErrStoreNotFound will be returned.

func (*Provider) OpenStore

func (p *Provider) OpenStore(name string) (newstorage.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.

func (*Provider) SetStoreConfig

func (p *Provider) SetStoreConfig(name string, config newstorage.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 newstorage.ErrStoreNotFound will be returned.

Jump to

Keyboard shortcuts

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