Documentation
¶
Index ¶
- Variables
- func NewLRUCacheItemReleaseStrategy(capacity int) *lruCacheItemReleaseStrategy
- type BasicCacheImpl
- type Cache
- type CacheItemConverter
- type CacheItemReleaseStrategy
- type CacheItemReleaseStrategyGenerator
- type CacheItemStorageProvider
- type GZipCacheItemStorageProvider
- type ShardingCache
- type ShardingMapStorageProvider
- type StorageProviderGenerator
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEmptyChain = errors.New("empty chain")
View Source
var ErrNotFoundInStorageErr = errors.New("not found in storage")
Functions ¶
func NewLRUCacheItemReleaseStrategy ¶
func NewLRUCacheItemReleaseStrategy(capacity int) *lruCacheItemReleaseStrategy
Types ¶
type BasicCacheImpl ¶
type BasicCacheImpl[T any] struct { // contains filtered or unexported fields }
func (*BasicCacheImpl[T]) Get ¶
func (c *BasicCacheImpl[T]) Get(key string) (T, error)
Get the instance. It retrives the data from the storage interface when it's not available in the cache.
func (*BasicCacheImpl[T]) SetAsync ¶
func (c *BasicCacheImpl[T]) SetAsync(key string, value []byte)
type Cache ¶
type Cache[T any] interface { // Get returns the associated data with converting to T Get(key string) (T, error) // SetAsync store the given cache data with the associated key in async. SetAsync(key string, value []byte) }
func NewCache ¶
func NewCache[T any](storage CacheItemStorageProvider, resolver CacheItemConverter[T], itemReleaseStrategy CacheItemReleaseStrategy) Cache[T]
type CacheItemConverter ¶
type CacheItemReleaseStrategyGenerator ¶
type CacheItemReleaseStrategyGenerator = func() CacheItemReleaseStrategy
type GZipCacheItemStorageProvider ¶
type GZipCacheItemStorageProvider struct {
// contains filtered or unexported fields
}
func NewGZipCacheItemStorageProvider ¶
func NewGZipCacheItemStorageProvider(parent CacheItemStorageProvider) *GZipCacheItemStorageProvider
type ShardingCache ¶
type ShardingCache[T any] struct { // contains filtered or unexported fields }
func NewShardingCache ¶
func NewShardingCache[T any](storageGenerator StorageProviderGenerator, resolver CacheItemConverter[T], itemReleaseStrategyGenerator CacheItemReleaseStrategyGenerator, shardingProvider common.MapShardingProvider) *ShardingCache[T]
func (*ShardingCache[T]) Get ¶
func (s *ShardingCache[T]) Get(key string) (T, error)
Get implements Cache.
func (*ShardingCache[T]) SetAsync ¶
func (s *ShardingCache[T]) SetAsync(key string, value []byte)
Set implements Cache.
type ShardingMapStorageProvider ¶
type ShardingMapStorageProvider struct {
// contains filtered or unexported fields
}
func NewShardingMapStorageProvider ¶
func NewShardingMapStorageProvider(shardingProvider common.MapShardingProvider) *ShardingMapStorageProvider
type StorageProviderGenerator ¶
type StorageProviderGenerator = func() CacheItemStorageProvider
Click to show internal directories.
Click to hide internal directories.