Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrValueIsDeleted = fmt.Errorf("value is deleted")
ErrValueIsDeleted is returned when value is deleted.
Functions ¶
This section is empty.
Types ¶
type BatchService ¶
type BatchService struct {
// contains filtered or unexported fields
}
BatchService is a batch service.
func NewBatchWrite ¶
func NewBatchWrite(batchSizeLimit int, formatter Formatter, provider batchProvider) *BatchService
NewBatchWrite new batch write. nolint: funlen
type FormattedProvider ¶
type FormattedProvider struct {
// contains filtered or unexported fields
}
FormattedProvider is a storage provider that allows for data to be formatted in an underlying provider.
func NewFormattedProvider ¶
func NewFormattedProvider(provider storage.Provider, formatter Formatter, skipIteratorFiltering bool, opts ...Option) *FormattedProvider
NewFormattedProvider instantiates a new FormattedProvider with the given Provider and Formatter. The Formatter is used to format data before being sent to the Provider for storage. The Formatter is also used to restore the original format of data being retrieved from Provider. If the underlying provider already does filtering using the startKey and endKey parameters in its Iterator(startKey, endKey string) method, then set skipIteratorFiltering to true to avoid redundant filtering in FormattedProvider.
func (*FormattedProvider) Close ¶
func (p *FormattedProvider) Close() error
Close closes all stores created in the underlying provider.
func (*FormattedProvider) CloseStore ¶
func (p *FormattedProvider) CloseStore(name string) error
CloseStore closes the store with the given name in the underlying provider.
func (*FormattedProvider) Flush ¶
func (p *FormattedProvider) Flush() error
Flush call batch svc to flush data. TODO this method need to be refactored.
type Formatter ¶
type Formatter interface { FormatPair(k string, v []byte) ([]byte, error) ParsePair([]byte) (k string, v []byte, err error) GenerateEDVDocumentID(k string) (string, error) }
Formatter represents a type that can convert data between two formats.
type Option ¶
type Option func(opts *FormattedProvider)
Option configures the formatted store.
func WithBatchWrite ¶
WithBatchWrite option is for batch write.
func WithCacheProvider ¶
WithCacheProvider option is for using caching provider.