cache

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanCacheDir

func CleanCacheDir(subDir CacheSubDir) error

func ClearCache

func ClearCache() error

func MkCacheDir

func MkCacheDir(subDir CacheSubDir, cacheKey string) (cacheDir string, cleanup func(), err error)

MkCacheDir creates a directory within configHome to be used for temporary storage and returns a function that can be called to remove it once it is no longer needed. If cacheKey is not empty, the cache directory will be deterministic and can be used to resume operations. Otherwise the directory will be generated with a random, non-colliding name.

func MkCacheFile

func MkCacheFile(subDir CacheSubDir, basename string) (tempFile *os.File, cleanup func(), err error)

func SetCacheHome

func SetCacheHome(cacheHome string)

func StatCache

func StatCache() (totalSize int64, subdirsSize map[string]int64, err error)

Types

type CacheSubDir

type CacheSubDir string
const (
	CachePackSubdir   CacheSubDir = "pack"
	CacheImportSubdir CacheSubDir = "import"
)

Jump to

Keyboard shortcuts

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