Documentation
¶
Overview ¶
Package hypercache provides a high-performance, generic caching library with configurable backends and eviction algorithms. It supports multiple backend types including in-memory and Redis, with various eviction strategies like LRU, LFU, and more. The package is designed to be flexible and extensible, allowing users to customize cache behavior through configuration options.
Example usage:
config := hypercache.NewConfig[string]("inmemory") cache := hypercache.NewHyperCache[string](config) cache.Set("key", "value", time.Hour) value, found := cache.Get("key")
Index ¶
- func ApplyHyperCacheOptions[T backend.IBackendConstrain](cache *HyperCache[T], options ...Option[T])
- type BackendManager
- type Config
- type DistMemoryBackendConstructor
- type HyperCache
- func (hyperCache *HyperCache[T]) Allocation() int64
- func (hyperCache *HyperCache[T]) Capacity() int
- func (hyperCache *HyperCache[T]) Clear(ctx context.Context) error
- func (hyperCache *HyperCache[T]) ClusterOwners(key string) []string
- func (hyperCache *HyperCache[T]) Count(ctx context.Context) int
- func (hyperCache *HyperCache[T]) DistHeartbeatMetrics() any
- func (hyperCache *HyperCache[T]) DistMembershipSnapshot() (members []struct{ ... }, replication int, vnodes int)
- func (hyperCache *HyperCache[T]) DistMetrics() any
- func (hyperCache *HyperCache[T]) DistRingHashSpots() []string
- func (hyperCache *HyperCache[T]) EvictionAlgorithm() string
- func (hyperCache *HyperCache[T]) EvictionInterval() time.Duration
- func (hyperCache *HyperCache[T]) ExpirationInterval() time.Duration
- func (hyperCache *HyperCache[T]) Get(ctx context.Context, key string) (any, bool)
- func (hyperCache *HyperCache[T]) GetMultiple(ctx context.Context, keys ...string) (map[string]any, map[string]error)
- func (hyperCache *HyperCache[T]) GetOrSet(ctx context.Context, key string, value any, expiration time.Duration) (any, error)
- func (hyperCache *HyperCache[T]) GetStats() stats.Stats
- func (hyperCache *HyperCache[T]) GetWithInfo(ctx context.Context, key string) (*cache.Item, bool)
- func (hyperCache *HyperCache[T]) List(ctx context.Context, filters ...backend.IFilter) ([]*cache.Item, error)
- func (hyperCache *HyperCache[T]) ManagementHTTPAddress() string
- func (hyperCache *HyperCache[T]) MaxCacheSize() int64
- func (hyperCache *HyperCache[T]) Remove(ctx context.Context, keys ...string) error
- func (hyperCache *HyperCache[T]) Set(ctx context.Context, key string, value any, expiration time.Duration) error
- func (hyperCache *HyperCache[T]) SetCapacity(ctx context.Context, capacity int)
- func (hyperCache *HyperCache[T]) Stop(ctx context.Context) error
- func (hyperCache *HyperCache[T]) TriggerEviction(_ context.Context)
- func (hyperCache *HyperCache[T]) TriggerExpiration()
- type IBackendConstructor
- type InMemoryBackendConstructor
- type JobFunc
- type ManagementHTTPOption
- type ManagementHTTPServer
- type Middleware
- type Option
- func WithEvictionAlgorithm[T backend.IBackendConstrain](name string) Option[T]
- func WithEvictionInterval[T backend.IBackendConstrain](evictionInterval time.Duration) Option[T]
- func WithExpirationInterval[T backend.IBackendConstrain](expirationInterval time.Duration) Option[T]
- func WithExpirationTriggerBuffer[T backend.IBackendConstrain](size int) Option[T]
- func WithExpirationTriggerDebounce[T backend.IBackendConstrain](interval time.Duration) Option[T]
- func WithManagementHTTP[T backend.IBackendConstrain](addr string, opts ...ManagementHTTPOption) Option[T]
- func WithMaxCacheSize[T backend.IBackendConstrain](maxCacheSize int64) Option[T]
- func WithMaxEvictionCount[T backend.IBackendConstrain](maxEvictionCount uint) Option[T]
- func WithStatsCollector[T backend.IBackendConstrain](name string) Option[T]
- type RedisBackendConstructor
- type RedisClusterBackendConstructor
- type Service
- type WorkerPool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyHyperCacheOptions ¶ added in v0.0.4
func ApplyHyperCacheOptions[T backend.IBackendConstrain](cache *HyperCache[T], options ...Option[T])
ApplyHyperCacheOptions applies the given options to the given cache.
Types ¶
type BackendManager ¶ added in v0.1.3
type BackendManager struct {
// contains filtered or unexported fields
}
BackendManager is a factory for creating HyperCache backend instances. It maintains a registry of backend constructors. We store them as any internally, and cast to the typed constructor at use site based on T.
func GetDefaultManager ¶ added in v0.1.3
func GetDefaultManager() *BackendManager
GetDefaultManager returns a new BackendManager with default backends pre-registered. This replaces the previous global instance with a factory function.
func NewBackendManager ¶ added in v0.1.3
func NewBackendManager() *BackendManager
NewBackendManager creates a new BackendManager with default backends pre-registered.
func NewEmptyBackendManager ¶ added in v0.1.6
func NewEmptyBackendManager() *BackendManager
NewEmptyBackendManager creates a new BackendManager without default backends. This is useful for testing or when you want to register only specific backends.
func (*BackendManager) RegisterBackend ¶ added in v0.1.3
func (hcm *BackendManager) RegisterBackend(name string, constructor any)
RegisterBackend registers a new backend constructor. The constructor should be a value implementing IBackendConstructor[T] for some T; stored as any.
type Config ¶ added in v0.0.4
type Config[T backend.IBackendConstrain] struct { // BackendType is the type of the backend to use. BackendType string // InMemoryOptions is a slice of options that can be used to configure the `InMemory`. InMemoryOptions []backend.Option[backend.InMemory] // RedisOptions is a slice of options that can be used to configure the `Redis`. RedisOptions []backend.Option[backend.Redis] // RedisClusterOptions is a slice of options to configure the `RedisCluster` backend. RedisClusterOptions []backend.Option[backend.RedisCluster] // DistMemoryOptions configure the distributed in-memory (sharded) backend. DistMemoryOptions []backend.DistMemoryOption // HyperCacheOptions is a slice of options that can be used to configure `HyperCache`. HyperCacheOptions []Option[T] }
Config is a struct that wraps all the configuration options to setup `HyperCache` and its backend.
func NewConfig ¶ added in v0.0.4
func NewConfig[T backend.IBackendConstrain](backendType string) *Config[T]
NewConfig returns a new `Config` struct with default values:
- `InMemoryOptions` is empty
- `RedisOptions` is empty
- `HyperCacheOptions` is set to: -- `WithExpirationInterval[T](30 * time.Minute)` -- `WithEvictionAlgorithm[T]("lfu")` -- `WithEvictionInterval[T](10 * time.Minute)`
Each of the above options can be overridden by passing a different option to the `NewConfig` function. It can be used to configure `HyperCache` and its backend and customize the behavior of the cache.
type DistMemoryBackendConstructor ¶ added in v0.2.0
type DistMemoryBackendConstructor struct{}
DistMemoryBackendConstructor constructs DistMemory backends.
func (DistMemoryBackendConstructor) Create ¶ added in v0.2.0
func (DistMemoryBackendConstructor) Create( ctx context.Context, _ *Config[backend.DistMemory], ) (backend.IBackend[backend.DistMemory], error)
Create creates a new DistMemory backend.
type HyperCache ¶
type HyperCache[T backend.IBackendConstrain] struct { // StatsCollector to collect cache statistics StatsCollector stats.ICollector // contains filtered or unexported fields }
HyperCache stores items with a key and optional expiration. It supports multiple backends and eviction algorithms. Configuration is provided via the Config struct using With* options. Background loops:
- expiration loop (interval: expirationInterval) scans for expired items
- eviction loop (interval: evictionInterval) evicts items via the configured algorithm
Channels:
- expirationTriggerCh triggers an on-demand expiration pass (coalesced)
- evictCh triggers an immediate eviction pass when interval is 0 and capacity exceeded
Synchronization:
- mutex protects eviction algorithm state
- stop channel signals background loops to stop
func New ¶ added in v0.0.5
func New[T backend.IBackendConstrain](ctx context.Context, bm *BackendManager, config *Config[T]) (*HyperCache[T], error)
New initializes a new HyperCache with the given configuration. The default configuration is:
- The eviction interval is set to 5 minutes.
- The eviction algorithm is set to LRU.
- The expiration interval is set to 30 minutes.
- The stats collector is set to the HistogramStatsCollector stats collector.
func NewInMemoryWithDefaults ¶ added in v0.0.5
func NewInMemoryWithDefaults(capacity int) (*HyperCache[backend.InMemory], error)
NewInMemoryWithDefaults initializes a new HyperCache with the default configuration. The default configuration is:
- The eviction interval is set to 10 minutes.
- The eviction algorithm is set to LRU.
- The expiration interval is set to 30 minutes.
- The capacity of the in-memory backend is set to 0 items (no limitations) unless specified.
- The maximum cache size in bytes is set to 0 (no limitations).
func (*HyperCache[T]) Allocation ¶ added in v0.1.0
func (hyperCache *HyperCache[T]) Allocation() int64
Allocation returns the size allocation in bytes of the current cache.
func (*HyperCache[T]) Capacity ¶
func (hyperCache *HyperCache[T]) Capacity() int
Capacity returns the capacity of the cache.
func (*HyperCache[T]) Clear ¶
func (hyperCache *HyperCache[T]) Clear(ctx context.Context) error
Clear removes all items from the cache.
func (*HyperCache[T]) ClusterOwners ¶ added in v0.2.0
func (hyperCache *HyperCache[T]) ClusterOwners(key string) []string
ClusterOwners returns the owners for a key if the distributed backend supports it; otherwise empty slice.
func (*HyperCache[T]) Count ¶ added in v0.1.0
func (hyperCache *HyperCache[T]) Count(ctx context.Context) int
Count returns the number of items in the cache.
func (*HyperCache[T]) DistHeartbeatMetrics ¶ added in v0.2.0
func (hyperCache *HyperCache[T]) DistHeartbeatMetrics() any
DistHeartbeatMetrics returns distributed heartbeat metrics if supported.
func (*HyperCache[T]) DistMembershipSnapshot ¶ added in v0.2.0
func (hyperCache *HyperCache[T]) DistMembershipSnapshot() (members []struct { ID string Address string State string Incarnation uint64 }, replication int, vnodes int, )
DistMembershipSnapshot returns a snapshot of membership if distributed backend; otherwise nil slice.
func (*HyperCache[T]) DistMetrics ¶ added in v0.2.0
func (hyperCache *HyperCache[T]) DistMetrics() any
DistMetrics returns distributed backend metrics if the underlying backend is DistMemory. Returns nil if unsupported.
func (*HyperCache[T]) DistRingHashSpots ¶ added in v0.2.0
func (hyperCache *HyperCache[T]) DistRingHashSpots() []string
DistRingHashSpots returns vnode hashes as hex strings if available (debug).
func (*HyperCache[T]) EvictionAlgorithm ¶ added in v0.2.0
func (hyperCache *HyperCache[T]) EvictionAlgorithm() string
EvictionAlgorithm returns eviction algorithm name.
func (*HyperCache[T]) EvictionInterval ¶ added in v0.2.0
func (hyperCache *HyperCache[T]) EvictionInterval() time.Duration
EvictionInterval returns configured eviction interval.
func (*HyperCache[T]) ExpirationInterval ¶ added in v0.2.0
func (hyperCache *HyperCache[T]) ExpirationInterval() time.Duration
ExpirationInterval returns configured expiration interval.
func (*HyperCache[T]) Get ¶
Get retrieves the item with the given key from the cache returning the value and a boolean indicating if the item was found.
func (*HyperCache[T]) GetMultiple ¶
func (hyperCache *HyperCache[T]) GetMultiple(ctx context.Context, keys ...string) (map[string]any, map[string]error)
GetMultiple retrieves the items with the given keys from the cache.
func (*HyperCache[T]) GetOrSet ¶
func (hyperCache *HyperCache[T]) GetOrSet(ctx context.Context, key string, value any, expiration time.Duration) (any, error)
GetOrSet retrieves the item with the given key. If the item is not found, it adds the item to the cache with the given value and expiration duration. If the capacity of the cache is reached, leverage the eviction algorithm.
func (*HyperCache[T]) GetStats ¶ added in v0.0.4
func (hyperCache *HyperCache[T]) GetStats() stats.Stats
GetStats returns the stats collected by the cache.
func (*HyperCache[T]) GetWithInfo ¶ added in v0.1.0
GetWithInfo retrieves the item with the given key from the cache returning the `Item` object and a boolean indicating if the item was found.
func (*HyperCache[T]) List ¶
func (hyperCache *HyperCache[T]) List(ctx context.Context, filters ...backend.IFilter) ([]*cache.Item, error)
List lists the items in the cache that meet the specified criteria. It takes in a variadic number of any type as filters, it then checks the backend type, and calls the corresponding implementation of the List function for that backend, with the filters passed in as arguments.
func (*HyperCache[T]) ManagementHTTPAddress ¶ added in v0.2.0
func (hyperCache *HyperCache[T]) ManagementHTTPAddress() string
ManagementHTTPAddress returns the bound address of the optional management HTTP server. Empty string when the server is disabled or failed to start.
func (*HyperCache[T]) MaxCacheSize ¶ added in v0.1.0
func (hyperCache *HyperCache[T]) MaxCacheSize() int64
MaxCacheSize returns the maximum size in bytes of the cache.
func (*HyperCache[T]) Remove ¶
func (hyperCache *HyperCache[T]) Remove(ctx context.Context, keys ...string) error
Remove removes items with the given key from the cache. If an item is not found, it does nothing.
func (*HyperCache[T]) Set ¶
func (hyperCache *HyperCache[T]) Set(ctx context.Context, key string, value any, expiration time.Duration) error
Set adds an item to the cache with the given key and value. If an item with the same key already exists, it updates the value of the existing item. If the expiration duration is greater than zero, the item will expire after the specified duration. If capacity is reached:
- when evictionInterval == 0 we evict immediately
- otherwise the background eviction loop will reclaim space
func (*HyperCache[T]) SetCapacity ¶
func (hyperCache *HyperCache[T]) SetCapacity(ctx context.Context, capacity int)
SetCapacity sets the capacity of the cache. If the new capacity is smaller than the current number of items in the cache, it evicts the excess items from the cache.
func (*HyperCache[T]) Stop ¶
func (hyperCache *HyperCache[T]) Stop(ctx context.Context) error
Stop function stops the expiration and eviction loops and closes the stop channel.
func (*HyperCache[T]) TriggerEviction ¶
func (hyperCache *HyperCache[T]) TriggerEviction(_ context.Context)
TriggerEviction sends a signal to the eviction loop to start.
func (*HyperCache[T]) TriggerExpiration ¶ added in v0.2.0
func (hyperCache *HyperCache[T]) TriggerExpiration()
TriggerExpiration exposes a manual expiration trigger (debounced/coalesced internally).
type IBackendConstructor ¶ added in v0.1.3
type IBackendConstructor[T backend.IBackendConstrain] interface { Create(ctx context.Context, cfg *Config[T]) (backend.IBackend[T], error) }
IBackendConstructor is an interface for backend constructors with type safety. It returns a typed backend.IBackend[T] instead of any.
type InMemoryBackendConstructor ¶ added in v0.1.3
type InMemoryBackendConstructor struct{}
InMemoryBackendConstructor constructs InMemory backends.
type JobFunc ¶ added in v0.1.3
type JobFunc func() error
JobFunc is a function that can be enqueued in a worker pool.
type ManagementHTTPOption ¶ added in v0.2.0
type ManagementHTTPOption func(*ManagementHTTPServer)
ManagementHTTPOption configures the management HTTP server.
func WithMgmtAuth ¶ added in v0.2.0
func WithMgmtAuth(fn func(fiber.Ctx) error) ManagementHTTPOption
WithMgmtAuth sets an auth function (return error to block).
func WithMgmtReadTimeout ¶ added in v0.2.0
func WithMgmtReadTimeout(d time.Duration) ManagementHTTPOption
WithMgmtReadTimeout sets read timeout.
func WithMgmtWriteTimeout ¶ added in v0.2.0
func WithMgmtWriteTimeout(d time.Duration) ManagementHTTPOption
WithMgmtWriteTimeout sets write timeout.
type ManagementHTTPServer ¶ added in v0.2.0
type ManagementHTTPServer struct {
// contains filtered or unexported fields
}
ManagementHTTPServer holds Fiber app and settings.
func NewManagementHTTPServer ¶ added in v0.2.0
func NewManagementHTTPServer(addr string, opts ...ManagementHTTPOption) *ManagementHTTPServer
NewManagementHTTPServer builds an HTTP server holder (lazy start).
func (*ManagementHTTPServer) Address ¶ added in v0.2.0
func (s *ManagementHTTPServer) Address() string
Address returns the bound address (useful when passing ":0" for ephemeral port). Empty if not started yet.
type Middleware ¶ added in v0.0.4
Middleware describes a service middleware.
type Option ¶
type Option[T backend.IBackendConstrain] func(*HyperCache[T])
Option is a function type that can be used to configure the `HyperCache` struct.
func WithEvictionAlgorithm ¶ added in v0.0.4
func WithEvictionAlgorithm[T backend.IBackendConstrain](name string) Option[T]
WithEvictionAlgorithm is an option that sets the eviction algorithm name field of the `HyperCache` struct. The eviction algorithm name determines which eviction algorithm will be used to evict items from the cache. The eviction algorithm name must be one of the following:
- "LRU" (Least Recently Used) - Implemented in the `eviction/lru.go` file
- "LFU" (Least Frequently Used) - Implemented in the `eviction/lfu.go` file
- "CAWOLFU" (Cache-Aware Write-Optimized LFU) - Implemented in the `eviction/cawolfu.go` file
- "FIFO" (First In First Out)
- "RANDOM" (Random)
- "CLOCK" (Clock) - Implemented in the `eviction/clock.go` file
- "ARC" (Adaptive Replacement Cache) - Experimental (not enabled by default)
- "TTL" (Time To Live)
- "LFUDA" (Least Frequently Used with Dynamic Aging)
- "SLRU" (Segmented Least Recently Used)
func WithEvictionInterval ¶
func WithEvictionInterval[T backend.IBackendConstrain](evictionInterval time.Duration) Option[T]
WithEvictionInterval is an option that sets the eviction interval field of the `HyperCache` struct. The eviction interval determines how often the cache will run the eviction process to remove the least recently used items.
func WithExpirationInterval ¶
func WithExpirationInterval[T backend.IBackendConstrain](expirationInterval time.Duration) Option[T]
WithExpirationInterval is an option that sets the expiration interval field of the `HyperCache` struct. The expiration interval determines how often the cache will check for and remove expired items.
func WithExpirationTriggerBuffer ¶ added in v0.1.6
func WithExpirationTriggerBuffer[T backend.IBackendConstrain](size int) Option[T]
WithExpirationTriggerBuffer sets the buffer size of the expiration trigger channel. If set to <= 0, the default (capacity/2, minimum 1) is used.
func WithExpirationTriggerDebounce ¶ added in v0.1.6
func WithExpirationTriggerDebounce[T backend.IBackendConstrain](interval time.Duration) Option[T]
WithExpirationTriggerDebounce sets an optional debounce interval for coalescing expiration triggers. Triggers arriving within this interval after the last accepted trigger may be dropped.
func WithManagementHTTP ¶ added in v0.2.0
func WithManagementHTTP[T backend.IBackendConstrain](addr string, opts ...ManagementHTTPOption) Option[T]
WithManagementHTTP enables the optional management HTTP server with the provided address and options. addr format example: ":8080" or "127.0.0.1:9090".
func WithMaxCacheSize ¶ added in v0.1.0
func WithMaxCacheSize[T backend.IBackendConstrain](maxCacheSize int64) Option[T]
WithMaxCacheSize is an option that sets the maximum size of the cache. The maximum size of the cache is the maximum number of items that can be stored in the cache. If the maximum size of the cache is reached, the least recently used item will be evicted from the cache.
func WithMaxEvictionCount ¶
func WithMaxEvictionCount[T backend.IBackendConstrain](maxEvictionCount uint) Option[T]
WithMaxEvictionCount is an option that sets the max eviction count field of the `HyperCache` struct. The max eviction count determines the maximum number of items that can be removed during a single eviction run.
func WithStatsCollector ¶
func WithStatsCollector[T backend.IBackendConstrain](name string) Option[T]
WithStatsCollector is an option that sets the stats collector field of the `HyperCache` struct. The stats collector is used to collect statistics about the cache.
type RedisBackendConstructor ¶ added in v0.1.3
type RedisBackendConstructor struct{}
RedisBackendConstructor constructs Redis backends.
type RedisClusterBackendConstructor ¶ added in v0.1.8
type RedisClusterBackendConstructor struct{}
RedisClusterBackendConstructor constructs Redis Cluster backends.
func (RedisClusterBackendConstructor) Create ¶ added in v0.1.8
func (RedisClusterBackendConstructor) Create( _ context.Context, cfg *Config[backend.RedisCluster], ) (backend.IBackend[backend.RedisCluster], error)
Create creates a new Redis Cluster backend.
type Service ¶ added in v0.0.4
type Service interface { // Capacity returns the capacity of the cache Capacity() int // Allocation returns the allocation in bytes of the current cache Allocation() int64 // Count returns the number of items in the cache Count(ctx context.Context) int // TriggerEviction triggers the eviction of the cache TriggerEviction(ctx context.Context) // Stop stops the cache Stop(ctx context.Context) error // GetStats returns the stats of the cache GetStats() stats.Stats // contains filtered or unexported methods }
Service is the service interface for the HyperCache. It enables middleware to be added to the service.
func ApplyMiddleware ¶ added in v0.0.4
func ApplyMiddleware(svc Service, mw ...Middleware) Service
ApplyMiddleware applies middlewares to a service.
type WorkerPool ¶ added in v0.1.3
type WorkerPool struct {
// contains filtered or unexported fields
}
WorkerPool is a pool of workers that can execute jobs concurrently.
func NewWorkerPool ¶ added in v0.1.3
func NewWorkerPool(workers int) *WorkerPool
NewWorkerPool creates a new worker pool with the given number of workers.
func (*WorkerPool) Enqueue ¶ added in v0.1.3
func (pool *WorkerPool) Enqueue(job JobFunc)
Enqueue adds a job to the worker pool.
func (*WorkerPool) Errors ¶ added in v0.1.3
func (pool *WorkerPool) Errors() <-chan error
Errors returns a channel that can be used to receive errors from the worker pool.
func (*WorkerPool) Resize ¶ added in v0.1.3
func (pool *WorkerPool) Resize(newSize int)
Resize resizes the worker pool.
func (*WorkerPool) Shutdown ¶ added in v0.1.3
func (pool *WorkerPool) Shutdown()
Shutdown shuts down the worker pool. It waits for all jobs to finish.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
__examples
|
|
internal
|
|
cluster
Package cluster contains primitives for node identity, membership tracking and consistent hashing used by distributed backends.
|
Package cluster contains primitives for node identity, membership tracking and consistent hashing used by distributed backends. |
constants
Package constants defines default configuration values and backend types for the hypercache system.
|
Package constants defines default configuration values and backend types for the hypercache system. |
dist
Package dist currently holds configuration primitives.
|
Package dist currently holds configuration primitives. |
introspect
Package introspect provides utilities for runtime inspection and type checking of cache backends.
|
Package introspect provides utilities for runtime inspection and type checking of cache backends. |
libs/serializer
Package serializer provides serialization interfaces and implementations for converting Go values to and from byte slices.
|
Package serializer provides serialization interfaces and implementations for converting Go values to and from byte slices. |
sentinel
Package sentinel provides standardized error definitions for the hypercache system.
|
Package sentinel provides standardized error definitions for the hypercache system. |
telemetry/attrs
Package attrs provides reusable OpenTelemetry attribute key constants to avoid duplication across middlewares.
|
Package attrs provides reusable OpenTelemetry attribute key constants to avoid duplication across middlewares. |
transport
Package transport defines the network transport abstraction (client + codec) for the distributed backend.
|
Package transport defines the network transport abstraction (client + codec) for the distributed backend. |
pkg
|
|
backend
Package backend provides interfaces and types for implementing cache backends.
|
Package backend provides interfaces and types for implementing cache backends. |
backend/redis
Package redis provides configuration options and utilities for Redis backend implementation.
|
Package redis provides configuration options and utilities for Redis backend implementation. |
backend/rediscluster
Package rediscluster provides configuration options and utilities for Redis Cluster backend implementation.
|
Package rediscluster provides configuration options and utilities for Redis Cluster backend implementation. |
cache
Package cache provides a thread-safe concurrent map implementation with sharding for improved performance in high-concurrency scenarios.
|
Package cache provides a thread-safe concurrent map implementation with sharding for improved performance in high-concurrency scenarios. |
cache/v2
Package cachev2 provides a high-performance concurrent map implementation optimized for cache operations.
|
Package cachev2 provides a high-performance concurrent map implementation optimized for cache operations. |
eviction
Package eviction - Adaptive Replacement Cache (ARC) algorithm implementation.
|
Package eviction - Adaptive Replacement Cache (ARC) algorithm implementation. |
middleware
Package middleware provides various middleware implementations for the hypercache service.
|
Package middleware provides various middleware implementations for the hypercache service. |
stats
Package stats provides a comprehensive statistics collection system for hypercache.
|
Package stats provides a comprehensive statistics collection system for hypercache. |
Package tests contains integration and helper utilities used across distributed backend tests (non-exported in main module).
|
Package tests contains integration and helper utilities used across distributed backend tests (non-exported in main module). |
testhelpers
Package tests provides shared test helpers (duplicate directory retained to appease earlier imports if any).
|
Package tests provides shared test helpers (duplicate directory retained to appease earlier imports if any). |