Documentation
¶
Index ¶
- type Cache
- type Entry
- type FileCache
- func (c *FileCache) Cleanup(ctx context.Context) error
- func (c *FileCache) Clear(ctx context.Context) error
- func (c *FileCache) Close() error
- func (c *FileCache) Delete(ctx context.Context, key string) error
- func (c *FileCache) Get(ctx context.Context, key string) ([]byte, error)
- func (c *FileCache) GetStats(ctx context.Context) (*Stats, error)
- func (c *FileCache) Set(ctx context.Context, key string, data []byte, ttl time.Duration) error
- func (c *FileCache) Size(ctx context.Context) (int64, error)
- type Stats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface {
Get(ctx context.Context, key string) ([]byte, error)
Set(ctx context.Context, key string, data []byte, ttl time.Duration) error
Delete(ctx context.Context, key string) error
Clear(ctx context.Context) error
Size(ctx context.Context) (int64, error)
Cleanup(ctx context.Context) error
GetStats(ctx context.Context) (*Stats, error)
}
Cache defines the interface for local file caching operations
type Entry ¶
type Entry struct {
Key string `json:"key"`
Data []byte `json:"data"`
CreatedAt time.Time `json:"created_at"`
ExpiresAt time.Time `json:"expires_at"`
Size int64 `json:"size"`
}
Entry represents a cache entry with metadata
type FileCache ¶
type FileCache struct {
// contains filtered or unexported fields
}
FileCache implements the Cache interface using the filesystem
func NewFileCache ¶
NewFileCache creates a new file-based cache
Click to show internal directories.
Click to hide internal directories.