Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface {
Get(key string) (interface{}, bool)
Set(key string, value interface{})
Delete(key string)
Clear() error
}
Cache defines the interface for caching
type FileCache ¶
type FileCache struct {
// contains filtered or unexported fields
}
FileCache implements file-based caching
func NewFileCache ¶
NewFileCache creates a new file-based cache
type MemoryCache ¶
type MemoryCache struct {
// contains filtered or unexported fields
}
MemoryCache implements in-memory caching (useful for testing)
func NewMemoryCache ¶
func NewMemoryCache(ttl time.Duration) *MemoryCache
NewMemoryCache creates a new in-memory cache
func (*MemoryCache) Delete ¶
func (c *MemoryCache) Delete(key string)
Delete removes a value from the cache
func (*MemoryCache) Get ¶
func (c *MemoryCache) Get(key string) (interface{}, bool)
Get retrieves a value from the cache
func (*MemoryCache) Set ¶
func (c *MemoryCache) Set(key string, value interface{})
Set stores a value in the cache
Click to show internal directories.
Click to hide internal directories.