Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type LocalCache ¶
type LocalCache struct {
// contains filtered or unexported fields
}
LocalCache is an in-memory cache implementation with a maximum size and LRU eviction policy
func NewLocalCache ¶
func NewLocalCache(maxSize int) *LocalCache
NewLocalCache initializes a new in-memory cache with a maximum size
func (*LocalCache) Delete ¶
func (c *LocalCache) Delete(key string) error
Delete removes an item from the cache
func (*LocalCache) Get ¶
func (c *LocalCache) Get(key string) (interface{}, bool)
Get retrieves an item from the cache
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
func NewRedisCache ¶
func NewRedisCache(addr string, password string, db int) (*RedisCache, error)
func (*RedisCache) Delete ¶
func (r *RedisCache) Delete(key string) error
func (*RedisCache) Get ¶
func (r *RedisCache) Get(key string) (interface{}, bool)
Click to show internal directories.
Click to hide internal directories.