Documentation
¶
Overview ¶
Package persistence provides SQLite-based persistence for MCP cache.
Index ¶
- type CacheMetadata
- type Store
- func (s *Store) Backup(backupPath string) error
- func (s *Store) Close() error
- func (s *Store) DeleteMetadata(hash string) error
- func (s *Store) DeleteOlderThan(d time.Duration) (int64, error)
- func (s *Store) GetMetadata(hash string) (*CacheMetadata, error)
- func (s *Store) GetStats() (totalEntries, totalSize int64, oldest, newest time.Time, err error)
- func (s *Store) GetStoreMetadata(key string) (string, error)
- func (s *Store) LoadAllMetadata() ([]*CacheMetadata, error)
- func (s *Store) Restore(backupPath string) error
- func (s *Store) SaveMetadata(meta *CacheMetadata) error
- func (s *Store) SetStoreMetadata(key, value string) error
- func (s *Store) Vacuum() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheMetadata ¶
type CacheMetadata struct {
Hash string `json:"hash"`
FilePath string `json:"file_path"`
Timestamp time.Time `json:"timestamp"`
Accessed time.Time `json:"accessed"`
HitCount int `json:"hit_count"`
Size int64 `json:"size"`
}
CacheMetadata represents persisted cache entry metadata (without content).
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store provides SQLite-backed persistence for cache metadata.
func (*Store) DeleteMetadata ¶
DeleteMetadata removes metadata by hash.
func (*Store) DeleteOlderThan ¶
DeleteOlderThan removes entries older than the given duration.
func (*Store) GetMetadata ¶
func (s *Store) GetMetadata(hash string) (*CacheMetadata, error)
GetMetadata retrieves metadata by hash.
func (*Store) GetStoreMetadata ¶
GetStoreMetadata retrieves a metadata value.
func (*Store) LoadAllMetadata ¶
func (s *Store) LoadAllMetadata() ([]*CacheMetadata, error)
LoadAllMetadata loads all cached metadata entries.
func (*Store) SaveMetadata ¶
func (s *Store) SaveMetadata(meta *CacheMetadata) error
SaveMetadata saves cache entry metadata.
func (*Store) SetStoreMetadata ¶
SetStoreMetadata sets a metadata value.
Click to show internal directories.
Click to hide internal directories.