Documentation ¶
Index ¶
- Constants
- func NewCache(config CacheConfig) (storage.Cacher, error)
- func NewDB(argDB ArgDB) (storage.Persister, error)
- func NewStorageCacherAdapter(cacher storage.AdaptedSizedLRUCache, db storage.Persister, ...) (storage.Cacher, error)
- type ArgDB
- type CacheConfig
- type CacheType
- type DBConfig
- type DBType
- type NilStorer
- type Unit
Constants ¶
const ( // LRUCache defines a cache identifier with least-recently-used eviction mechanism LRUCache = storageUnit.LRUCache // SizeLRUCache defines a cache identifier with least-recently-used eviction mechanism and fixed size in bytes SizeLRUCache = storageUnit.SizeLRUCache )
const ( // LvlDB represents a levelDB storage identifier LvlDB = storageUnit.LvlDB // LvlDBSerial represents a levelDB storage with serialized operations identifier LvlDBSerial = storageUnit.LvlDBSerial // MemoryDB represents an in memory storage identifier MemoryDB = storageUnit.MemoryDB )
LvlDB currently the only supported DBs More to be added
Variables ¶
This section is empty.
Functions ¶
func NewCache ¶
func NewCache(config CacheConfig) (storage.Cacher, error)
NewCache creates a new cache from a cache config
func NewStorageCacherAdapter ¶
func NewStorageCacherAdapter( cacher storage.AdaptedSizedLRUCache, db storage.Persister, storedDataFactory storage.StoredDataFactory, marshaller marshal.Marshalizer, ) (storage.Cacher, error)
NewStorageCacherAdapter creates a new storageCacherAdapter
Types ¶
type ArgDB ¶
type ArgDB = storageUnit.ArgDB
ArgDB is a structure that is used to create a new storage.Persister implementation
type CacheConfig ¶
type CacheConfig = storageUnit.CacheConfig
CacheConfig holds the configurable elements of a cache
type CacheType ¶
type CacheType = storageUnit.CacheType
CacheType represents the type of the supported caches
type DBConfig ¶
type DBConfig = storageUnit.DBConfig
DBConfig holds the configurable elements of a database
type DBType ¶
type DBType = storageUnit.DBType
DBType represents the type of the supported databases
type NilStorer ¶
type NilStorer = storageUnit.NilStorer
NilStorer resembles a disabled implementation of the Storer interface
type Unit ¶
type Unit = storageUnit.Unit
Unit represents a storer's data bank holding the cache and persistence unit
func NewStorageUnit ¶
NewStorageUnit is the constructor for the storage unit, creating a new storage unit from the given cacher and persister.
func NewStorageUnitFromConf ¶
func NewStorageUnitFromConf(cacheConf CacheConfig, dbConf DBConfig) (*Unit, error)
NewStorageUnitFromConf creates a new storage unit from a storage unit config