Versions in this module Expand all Collapse all v1 v1.999.0 Nov 17, 2022 Changes in this version + func NewCache(config CacheConfig) (storage.Cacher, error) + func NewDB(argDB ArgDB) (storage.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 Unit struct + func NewStorageUnit(c storage.Cacher, p storage.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