Documentation
¶
Overview ¶
Package cache provides file-based caching for API responses
Index ¶
- Constants
- func GenerateKey(params ...interface{}) string
- type Cache
- func (c *Cache) CleanExpired() (int, error)
- func (c *Cache) Clear() error
- func (c *Cache) Delete(key string) error
- func (c *Cache) Exists(key string) bool
- func (c *Cache) Get(key string) ([]byte, bool)
- func (c *Cache) IsEnabled() bool
- func (c *Cache) Set(key string, data []byte) error
- func (c *Cache) SetEnabled(enabled bool)
- func (c *Cache) Stats() (entries int, totalSize int64, err error)
- type Entry
- type Option
Constants ¶
View Source
const ( // DefaultTTL is the default time-to-live for cache entries DefaultTTL = 24 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
func GenerateKey ¶
func GenerateKey(params ...interface{}) string
GenerateKey creates a unique cache key from parameters
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache provides file-based caching functionality
func (*Cache) CleanExpired ¶
CleanExpired removes all expired entries from the cache
func (*Cache) SetEnabled ¶
SetEnabled enables or disables the cache
Click to show internal directories.
Click to hide internal directories.