Versions in this module Expand all Collapse all v1 v1.0.0 Oct 2, 2022 Changes in this version + const HashType + const ListType + const SetType + const StringType + const ZSetType + var ErrIndexKeySerialization = errors.New("during index serialization key not found in index") + var ErrKeyNotFound = errors.New("key not found") + var ErrSecuringReaderPoolDrained = errors.New("pool is drained, no readers available") + var ErrSecuringReaderTimeout = errors.New("timeout securing reader (timed out getting one from the pool") + var ErrTimedOutDrainingPool = errors.New("timed out draining pool") + func MockJsonlBytes(records []Record) []byte + func NewReadSeekCloser(readSeeker io.ReadSeeker) io.ReadSeekCloser + type Config struct + DefaultTimeout time.Duration + DrainTimeout time.Duration + KeysDontNeedSorting bool + MaxConnections int + type CurrentFile struct + FileName string + IndexFileName string + type ErrCreatingPool struct + Err error + func (e *ErrCreatingPool) Error() string + type ErrReadingIndex struct + Err error + func (e *ErrReadingIndex) Error() string + type ErrReadingRecordFromDisk struct + Err error + func (e ErrReadingRecordFromDisk) Error() string + type HashRecord struct + Fields map[string]string + func (hr *HashRecord) ScanFields(cursor int, count int, pattern string) (fields []string, last int, err error) + type IndexRecord struct + Key string + Len int + Offset int64 + Type string + type ListRecord struct + Elements []string + type MockReaderSeekCloser struct + func (*MockReaderSeekCloser) Close() error + func (m *MockReaderSeekCloser) Read(p []byte) (n int, err error) + func (m *MockReaderSeekCloser) Seek(offset int64, whence int) (int64, error) + type OpenReaderSeekCloser func() (io.ReadSeekCloser, error) + type OrderedSetElement struct + Score float64 + Value string + type OrderedSetRecord struct + Elements []OrderedSetElement + type ReaderPool struct + func NewEmptyReaderPool() *ReaderPool + func NewReaderPool(openReaderSeekCloser OpenReaderSeekCloser) (readerPool *ReaderPool, err error) + func NewReaderPoolAdvanced(openReaderSeekCloser OpenReaderSeekCloser, maxConnections int, ...) (readerPool *ReaderPool, err error) + func (p *ReaderPool) Drain() (err error) + func (p *ReaderPool) DrainWithTimeout(timeout time.Duration) (err error) + func (p *ReaderPool) GetReader() (reader io.ReadSeekCloser, err error) + func (p *ReaderPool) GetReaderWithTimeout(timeout time.Duration) (reader io.ReadSeekCloser, err error) + func (p *ReaderPool) ReturnReader(reader io.ReadSeekCloser) + type Record struct + HashRecord *HashRecord + Key string + ListRecord *ListRecord + OrdderSetRecord *OrderedSetRecord + StringRecord *StringRecord + Type string + func MockRecords() (records []Record) + func (r *Record) String() string + type Store struct + StoreIndex *StoreIndex + func NewEmptyStore() *Store + func NewStoreFromRecords(openReaderSeekCloser OpenReaderSeekCloser) (store *Store, err error) + func NewStoreFromRecordsWithConfig(openReaderSeekCloser OpenReaderSeekCloser, config Config) (store *Store, err error) + func NewStoreFromRecordsWithIndex(openReaderSeekCloser OpenReaderSeekCloser, index io.Reader) (store *Store, err error) + func NewStoreFromRecordsWithIndexAndConfig(openReaderSeekCloser OpenReaderSeekCloser, index io.Reader, config Config) (store *Store, err error) + func (hr *Store) ScanFields(start int, count int, pattern string) (records []IndexRecord, cursor int, err error) + func (s *Store) GetLen() int + func (s *Store) GetRecord(key string) (record *Record, err error) + func (s *Store) GetRecordIndex(key string) (*IndexRecord, error) + type StoreIndex struct + Index map[string]IndexRecord + SortedKeys []string + func BuildIndex(in io.Reader) (store *StoreIndex, err error) + func ReadJsonlIndex(in io.Reader, keysDontNeedSorting bool) (store *StoreIndex, err error) + func (s *StoreIndex) WriteJsonl(out io.Writer) (err error) + type StringRecord struct + Value string