Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewProvider ¶
func NewProvider(providers *collcommon.Providers, opts ...Option) olapi.Provider
NewProvider returns a new collection data provider
Types ¶
type Decorator ¶
type Decorator interface { // BeforeLoad has the opportunity to decorate the key before target is loaded or deleted. BeforeLoad(key *storeapi.Key) (*storeapi.Key, error) // AfterQuery has the opportunity to decorate the key and/or value that is returned from a DB query. AfterQuery(key *storeapi.Key, value *storeapi.ExpiringValue) (*storeapi.Key, *storeapi.ExpiringValue, error) }
Decorator allows the key/value to be modified/validated before being persisted. It is also applied to query results before the results are returned to the caller.
type Option ¶
type Option func(p *Provider)
Option is a provider option
func WithDecorator ¶
func WithDecorator(collType pb.CollectionType, decorator Decorator) Option
WithDecorator sets the decorator
func WithValidator ¶
func WithValidator(collType pb.CollectionType, validator Validator) Option
WithValidator sets the key/value validator
type Provider ¶
type Provider struct { *collcommon.Providers // contains filtered or unexported fields }
Provider is a collection data data provider.
Click to show internal directories.
Click to hide internal directories.