cache

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheLocation

type CacheLocation struct {
	Path string
	Type string
}

CacheLocation represents a cache directory location with its path and type

type CacheType

type CacheType string

CacheType represents the type of cache (system or application)

const (
	SystemCache CacheType = "system" // System-wide cache
	AppCache    CacheType = "app"    // Application-specific cache
)

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager handles cache operations for different operating systems

func NewCacheManager

func NewCacheManager(fm filemanager.FileManager) *Manager

NewCacheManager creates a new cache manager instance for the current OS

func (*Manager) ClearCache

func (m *Manager) ClearCache() (deleteError error)

ClearCache removes all files from cache locations using OS-specific deletion methods

func (*Manager) GetOS added in v1.5.0

func (m *Manager) GetOS() OS

func (*Manager) ScanAllLocations

func (m *Manager) ScanAllLocations() []ScanResult

ScanAllLocations concurrently scans all cache locations and returns their statistics

type OS

type OS string

OS represents supported operating systems

const (
	Windows OS = "windows"
	Linux   OS = "linux"
)

type ScanResult

type ScanResult struct {
	FileCount int64  // Number of files found
	Path      string // Path that was scanned
	Size      int64  // Total size of cache in bytes
	Error     error  // Any error that occurred during scanning
}

ScanResult contains information about a cache scan operation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL