Documentation
¶
Index ¶
- type Cache
- func (c *Cache) Cleanup(ctx context.Context) error
- func (c *Cache) Clear() error
- func (c *Cache) Delete(key string) error
- func (c *Cache) Get(key string) ([]byte, bool)
- func (c *Cache) GetCookbook(name, version string) ([]byte, bool)
- func (c *Cache) HitRate() float64
- func (c *Cache) Put(key string, data []byte) error
- func (c *Cache) PutCookbook(cookbook *berkshelf.Cookbook, data []byte) error
- func (c *Cache) Size() int64
- func (c *Cache) Stats() *CacheStats
- type CacheCheckResult
- type CacheEntry
- type CacheStats
- type Installer
- func (i *Installer) CheckCacheForRequirements(ctx context.Context, requirements []*resolver.Requirement) (*CacheCheckResult, error)
- func (i *Installer) CleanupCache(ctx context.Context) error
- func (i *Installer) DownloadAndCache(ctx context.Context, resolution *resolver.Resolution) error
- func (i *Installer) GetCacheStats() *CacheStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache provides advanced caching capabilities
func (*Cache) GetCookbook ¶
GetCookbook retrieves a cookbook from the cache
func (*Cache) PutCookbook ¶
PutCookbook stores a cookbook in the cache
type CacheCheckResult ¶
type CacheCheckResult struct {
CachedCookbooks []*resolver.ResolvedCookbook
UncachedRequirements []*resolver.Requirement
CacheHitCount int
CacheMissCount int
}
CacheCheckResult contains the result of cache checking
type CacheEntry ¶
type CacheEntry struct {
Key string `json:"key"`
Path string `json:"path"`
Size int64 `json:"size"`
CreatedAt time.Time `json:"created_at"`
AccessedAt time.Time `json:"accessed_at"`
AccessCount int64 `json:"access_count"`
Checksum string `json:"checksum"`
}
CacheEntry represents a cached item with metadata
type CacheStats ¶
type CacheStats struct {
Hits int64 `json:"hits"`
Misses int64 `json:"misses"`
Evictions int64 `json:"evictions"`
TotalSize int64 `json:"total_size"`
LastCleanup time.Time `json:"last_cleanup"`
// contains filtered or unexported fields
}
CacheStats tracks cache performance metrics
type Installer ¶
type Installer struct {
// contains filtered or unexported fields
}
Installer handles cookbook caching during install operations
func NewInstaller ¶
NewInstaller creates a new cache installer
func (*Installer) CheckCacheForRequirements ¶
func (i *Installer) CheckCacheForRequirements(ctx context.Context, requirements []*resolver.Requirement) (*CacheCheckResult, error)
CheckCacheForRequirements checks which requirements are already cached
func (*Installer) CleanupCache ¶
CleanupCache performs cache cleanup
func (*Installer) DownloadAndCache ¶
DownloadAndCache downloads and caches resolved cookbooks with progress reporting
func (*Installer) GetCacheStats ¶
func (i *Installer) GetCacheStats() *CacheStats
GetCacheStats returns cache statistics
Click to show internal directories.
Click to hide internal directories.