Versions in this module Expand all Collapse all v0 v0.0.1 Aug 23, 2024 Changes in this version + const MaxRetriesToCreateDB + const SleepTimeBetweenCreateDBRetries + var ErrNilPersisterFactory = errors.New("nil persister factory") + func NewCache(config CacheConfig) (types.Cacher, error) + func NewDB(persisterFactory PersisterFactoryHandler, path string) (types.Persister, error) + type ArgDB struct + BatchDelaySeconds int + DBType DBType + MaxBatchSize int + MaxOpenFiles int + Path string + type CacheConfig struct + Capacity uint32 + Name string + Shards uint32 + SizeInBytes uint64 + SizeInBytesPerSender uint32 + SizePerSender uint32 + Type CacheType + func (config *CacheConfig) String() string + type CacheType string + const FIFOShardedCache + const LRUCache + const SizeLRUCache + type DBConfig struct + BatchDelaySeconds int + FilePath string + MaxBatchSize int + MaxOpenFiles int + Type DBType + type DBType string + const LvlDB + const LvlDBSerial + const MemoryDB + type HasherType string + const Blake2b + const Fnv + const Keccak + func (h HasherType) NewHasher() (hashing.Hasher, error) + type NilStorer struct + func NewNilStorer() *NilStorer + func (ns *NilStorer) ClearCache() + func (ns *NilStorer) Close() error + func (ns *NilStorer) DestroyUnit() error + func (ns *NilStorer) Get(_ []byte) ([]byte, error) + func (ns *NilStorer) GetBulkFromEpoch(_ [][]byte, _ uint32) ([]storageCore.KeyValuePair, error) + func (ns *NilStorer) GetFromEpoch(_ []byte, _ uint32) ([]byte, error) + func (ns *NilStorer) GetOldestEpoch() (uint32, error) + func (ns *NilStorer) Has(_ []byte) error + func (ns *NilStorer) IsInterfaceNil() bool + func (ns *NilStorer) Put(_, _ []byte) error + func (ns *NilStorer) PutInEpoch(_, _ []byte, _ uint32) error + func (ns *NilStorer) RangeKeys(_ func(key []byte, val []byte) bool) + func (ns *NilStorer) Remove(_ []byte) error + func (ns *NilStorer) RemoveFromCurrentEpoch(_ []byte) error + func (ns *NilStorer) SearchFirst(_ []byte) ([]byte, error) + type PersisterFactoryHandler interface + Create func(path string) (types.Persister, error) + IsInterfaceNil func() bool + type ShardIDProviderType string + const BinarySplit + type Unit struct + func NewStorageUnit(c types.Cacher, p types.Persister) (*Unit, error) + func NewStorageUnitFromConf(cacheConf CacheConfig, dbConf DBConfig, ...) (*Unit, error) + func (u *Unit) ClearCache() + func (u *Unit) Close() error + func (u *Unit) DestroyUnit() error + func (u *Unit) Get(key []byte) ([]byte, error) + func (u *Unit) GetBulkFromEpoch(keys [][]byte, _ uint32) ([]storageCore.KeyValuePair, error) + func (u *Unit) GetFromEpoch(key []byte, _ uint32) ([]byte, error) + func (u *Unit) GetOldestEpoch() (uint32, error) + func (u *Unit) Has(key []byte) error + func (u *Unit) IsInterfaceNil() bool + func (u *Unit) Put(key, data []byte) error + func (u *Unit) PutInEpoch(key, data []byte, _ uint32) error + func (u *Unit) RangeKeys(handler func(key []byte, value []byte) bool) + func (u *Unit) Remove(key []byte) error + func (u *Unit) RemoveFromCurrentEpoch(key []byte) error + func (u *Unit) SearchFirst(key []byte) ([]byte, error) + type UnitConfig struct + CacheConf CacheConfig + DBConf DBConfig