Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CollOption ¶
type CollOption func(c *collTypeConfig)
CollOption is a collection option
func WithCacheEnabled ¶ added in v0.1.5
func WithCacheEnabled() CollOption
WithCacheEnabled enables caching for the given collection type
func WithDecorator ¶
func WithDecorator(decorator Decorator) CollOption
WithDecorator sets a decorator for a collection type allowing the key/value to be validated/modified before being persisted
type Decorator ¶
type Decorator interface { // BeforeSave has the opportunity to decorate the key and/or value before the key-value is saved. BeforeSave(key *storeapi.Key, value *storeapi.ExpiringValue) (*storeapi.Key, *storeapi.ExpiringValue, error) // BeforeLoad has the opportunity to decorate the key before it is loaded/deleted. BeforeLoad(key *storeapi.Key) (*storeapi.Key, error) }
Decorator allows the key/value to be modified/validated before being persisted.
type Option ¶
type Option func(p *StoreProvider)
Option is a store provider option
func WithCollectionType ¶
func WithCollectionType(collType pb.CollectionType, opts ...CollOption) Option
WithCollectionType adds a collection type to the set of collection types supported by the off-ledger store along with any options
type StoreProvider ¶
StoreProvider is a store provider
func New ¶
func New( identifierProvider collcommon.IdentifierProvider, identityDeserializerProvider collcommon.IdentityDeserializerProvider, collConfigProvider collcommon.CollectionConfigProvider, opts ...Option) *StoreProvider
New returns a store provider factory
func (*StoreProvider) OpenStore ¶
func (sp *StoreProvider) OpenStore(channelID string) (olapi.Store, error)
OpenStore opens the store for the given channel
func (*StoreProvider) StoreForChannel ¶
func (sp *StoreProvider) StoreForChannel(channelID string) olapi.Store
StoreForChannel returns the store for the given channel