Documentation
¶
Index ¶
- func CleanCacheDir(subDir CacheSubDir) error
- func ClearCache() error
- func MkCacheDir(subDir CacheSubDir, cacheKey string) (cacheDir string, cleanup func(), err error)
- func MkCacheFile(subDir CacheSubDir, basename string) (tempFile *os.File, cleanup func(), err error)
- func SetCacheHome(cacheHome string)
- func StatCache() (totalSize int64, subdirsSize map[string]int64, err error)
- type CacheSubDir
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)
Types ¶
type CacheSubDir ¶
type CacheSubDir string
const ( CachePackSubdir CacheSubDir = "pack" CacheImportSubdir CacheSubDir = "import" )
Click to show internal directories.
Click to hide internal directories.