storageunit

package
v1.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2025 License: GPL-3.0 Imports: 6 Imported by: 3 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// LRUCache defines a cache identifier with least-recently-used eviction mechanism
	LRUCache = common.LRUCache
	// SizeLRUCache defines a cache identifier with least-recently-used eviction mechanism and fixed size in bytes
	SizeLRUCache = common.SizeLRUCache
)
View Source
const (
	// LvlDB represents a levelDB storage identifier
	LvlDB = common.LvlDB
	// LvlDBSerial represents a levelDB storage with serialized operations identifier
	LvlDBSerial = common.LvlDBSerial
	// MemoryDB represents an in memory storage identifier
	MemoryDB = common.MemoryDB
)

DB types that are currently supported

View Source
const (
	BinarySplit = common.BinarySplit
)

Shard id provider types that are currently supported

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 NewDB

func NewDB(args ArgDB) (storage.Persister, error)

NewDB creates a new database from database 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 = factory.ArgDB

ArgDB is a structure that is used to create a new storage.Persister implementation

type CacheConfig

type CacheConfig = common.CacheConfig

CacheConfig holds the configurable elements of a cache

type CacheType

type CacheType = common.CacheType

CacheType represents the type of the supported caches

type DBConfig

type DBConfig = common.DBConfig

DBConfig holds the configurable elements of a database

type DBType

type DBType = common.DBType

DBType represents the type of the supported databases

type NilStorer

type NilStorer = storageUnit.NilStorer

NilStorer resembles a disabled implementation of the Storer interface

func NewNilStorer

func NewNilStorer() *NilStorer

NewNilStorer will return a nil storer

type ShardIDProviderType added in v1.6.0

type ShardIDProviderType = common.ShardIDProviderType

ShardIDProviderType represents the type of the supported shard id providers

type Unit

type Unit = storageUnit.Unit

Unit represents a storer's data bank holding the cache and persistence unit

func NewStorageUnit

func NewStorageUnit(c storage.Cacher, p storage.Persister) (*Unit, error)

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, persisterFactory storage.PersisterFactoryHandler) (*Unit, error)

NewStorageUnitFromConf creates a new storage unit from a storage unit config

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL